Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10329 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64700 invoked by uid 1010); 8 Jun 2004 18:31:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 64589 invoked from network); 8 Jun 2004 18:31:32 -0000 Received: from unknown (HELO amber.vis-av.com) (66.92.75.243) by pb1.pair.com with SMTP; 8 Jun 2004 18:31:32 -0000 Received: (qmail 4190 invoked from network); 8 Jun 2004 18:31:25 -0000 Received: from unknown (HELO random.internal) (192.168.1.9) by amber.internal with SMTP; 8 Jun 2004 18:31:25 -0000 Received: (nullmailer pid 18654 invoked by uid 0); Tue, 08 Jun 2004 18:31:19 -0000 To: Robert Janeczek Cc: internals@lists.php.net References: <20040608175939.47739.qmail@pb1.pair.com> Reply-To: Derrell.Lipman@UnwiredUniverse.com Date: Tue, 08 Jun 2004 14:31:19 -0400 In-Reply-To: <20040608175939.47739.qmail@pb1.pair.com> ("Robert Janeczek"'s message of "Tue, 8 Jun 2004 20:07:22 +0200") Message-ID: Lines: 17 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i386-debian-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [PHP-DEV] 'false' - boolean interpratation From: Derrell.Lipman@UnwiredUniverse.com "Robert Janeczek" writes: > is 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