ID: 41923 Updated by: [EMAIL PROTECTED] Reported By: zoe at uk dot ibm dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5CVS-2007-07-08 (CVS) New Comment:
Sorry - this is nonsense - willopen another with correct description Previous Comments: ------------------------------------------------------------------------ [2007-07-08 12:09:31] zoe at uk dot ibm dot com Description: ------------ The manual states that ini_set() "returns the old value on success, FALSE on failure". When the initial value of a configuration option is an empty string ini_set() will give a misleading result as shown on the test case below. This bug is related to 41922. The ini_set() code which causes the problem is: old_value = zend_ini_string(Z_STRVAL_PP(varname), Z_STRLEN_PP(varname)+1, 0); /* copy to return here, because alter might free it! */ if (old_value) { RETVAL_STRING(old_value, 1); } else { RETVAL_FALSE; } So if response is NULL we set a return code of FALSE. Reproduce code: --------------- --TEST-- Test to make sure that ini_set returns old value on success, false on failure --FILE-- <?php var_dump(ini_get("error_log")); var_dump(ini_set("error_log","/tmp/log")); var_dump(ini_get("error_log")); ?> --EXPECT-- string(0) "" string(0) "" string(8) "/tmp/log" Expected result: ---------------- See above Actual result: -------------- bool(false) <-- see bug 41922 bool(false) <-- implies ini_set() failure, it actually succeeds. string(8) "/tmp/log" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41923&edit=1