|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-08 15:19 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 21:00:01 2026 UTC |
Description: ------------ The manual states "Returns the value of the configuration option as a string on success, or an empty string on failure" Some options (eg docref_ext, disable_classes) have default values of an empty string, in these cases ini_get() will return an empty string when the function has failed AND when it has succeeded. The problem is in the following code: ZEND_API char *zend_ini_string(char *name, uint name_length, int orig) { zend_ini_entry *ini_entry; TSRMLS_FETCH(); if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { if (orig && ini_entry->modified) { return ini_entry->orig_value; } else { return ini_entry->value; } } return ""; } Reproduce code: --------------- Here is a test that will always pass even when ini_get fails. --TEST-- ini_get returns value of the configuration option as a string on success, empty string on failure --FILE-- <?php var_dump(ini_get("disable_classes")); ?> --EXPECT-- string(0) "" Expected result: ---------------- I would like to be able to see a failure - if ini_get() fails. For example ini_get() could return FALSE on failure (as ini_set() does), if there are no configuration options that have a default value of FALSE. Actual result: -------------- Always a null string.