Re: 'false' - boolean interpratation
| From: | Nick Loeve | Date: | Wed, 09 Jun 2004 00:23:40 +0000 |
| Subject: | Re: 'false' - boolean interpratation | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10331@lists.php.net to get a copy of this message | ||
Derrell Lipman wrote:
"Robert Janeczek" <rashid@ds.pg.gda.pl> writes:or use integers in the xml file and force type casting (integer)$xmlTextis there any way that string 'false' (and its variations with capital letters) could be interpeted as boolean of value false? i have xml configuration file that has some switches (true/false) in it. when i use this values in functions that require booleans i get true every time (as string isn`t empty) :/ i hoped that at least with explicit type cast i could go around this problem, but i didn`t help. how about adding this special case to conversion rules? creating if`s around such code doesn`t make me happy at all :]What do eval('false') and eval('true') return? You can probably just do eval(xmlText) to get the results you're looking for. (Just beware that the xmlText actually contains one of the values "true" or "false", and not some malicious php code.) Derrell