PHP 8.5.0 Alpha 4 available for testing

Voting

: min(three, one)?
(Example: nine)

The Note You're Voting On

johnzoet at netscape dot com
23 years ago
[[[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:

<?php
if (empty($blnResult) or (!$blnResult)) {
echo
"setting cannot be set";
exit;
}
?>

<< Back to user notes page

To Top