|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-08 13:35 UTC] zoe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 21:00:01 2026 UTC |
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"