note 19874 modified in function.ini-set by philip

From: Date: Thu, 11 Jul 2002 09:26:07 +0000
Subject: note 19874 modified in function.ini-set by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-32892@lists.php.net to get a copy of this message
[[[Editors note: Just because you're able to set something doesn't mean it will work as expected. Depends on the setting. For example. setting register_globals at runtime will be of little use as its job has already been completed by the time it reaches your script. ]]] When a setting can not be changed in a user script, the return value of ini_set is "empty", not "false" as you may expect. If you check in your script for return value is "false" the script will continue processing, although the setting has not been set. The boolean return value is used for settings that can be changed in a script. Otherwise the empty value is returned. To test for both error conditions use: if (empty($blnResult) or (!$blnResult)) { echo "setting cannot be set"; exit; } --was-- When a setting can not be changed in a user script, the return value of ini_set is "empty", not "false" as you may expect. If you check in your script for return value is "false" the script will continue processing, although the setting has not been set. The boolean return value is used for settings that can be changed in a script. Otherwise the empty value is returned. To test for both error conditions use: if (empty($blnResult) or (!$blnResult)) { echo "setting cannot be set"; exit; } http://www.php.net/manual/en/function.ini-set.php

« previous php.notes (#32892) next »