note 117232 added to function.ini-set

From: Date: Wed, 06 May 2015 17:22:01 +0000
Subject: note 117232 added to function.ini-set
Groups: php.notes 
Request: Send a blank email to php-notes+get-202460@lists.php.net to get a copy of this message
Whilst most boolean settings can be disabled by passing '0', 'Off' or `No' (in fact anything that is not '1', 'On' or 'Yes' - not case-sentive) to ini_set(), it should be noted that ini_get() returns the literal string as set. So if you later want to check this setting by calling ini_get() and it's been set to 'Off' (a non-empty string that evaluates to True), then you'll have to specifically check for this in a (case-insensitive) string comparison, rather than the simpler: if (ini_get('config_setting')) { /* ... */ } So, if you need to disable boolean settings I think it's preferable to set them to '0' (which simply evaluates to False). ---- Server IP: 72.52.91.14 Probable Submitter: 86.183.92.64 ---- Manual Page -- http://php.net/manual/en/function.ini-set.php Edit -- https://master.php.net/note/edit/117232 Del: integrated -- https://master.php.net/note/delete/117232/integrated Del: useless -- https://master.php.net/note/delete/117232/useless Del: bad code -- https://master.php.net/note/delete/117232/bad+code Del: spam -- https://master.php.net/note/delete/117232/spam Del: non-english -- https://master.php.net/note/delete/117232/non-english Del: in docs -- https://master.php.net/note/delete/117232/in+docs Del: other reasons-- https://master.php.net/note/delete/117232 Reject -- https://master.php.net/note/reject/117232 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#202460) next »