Re: [PHP4BETA] broken or probably not implement!

From: Date: Fri, 18 Feb 2000 11:41:57 +0000
Subject: Re: [PHP4BETA] broken or probably not implement!
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-10442@lists.php.net to get a copy of this message
I'm not sure what you're saying here, all of the results reported by PHP are correct. 10||1 is true (boolean). The fact that Perl reports 10 is meaningless, any value that translates into true is valid. If you want to conduct bitwise operations, you should be using the bitwise operators, i.e. 10|1. Zeev On Fri, 18 Feb 2000, Faisal Nasim wrote: > Greetings, > > PHP could use some more flexibility and some bug fixing! > > $str = 10 || 1; // 1 > $str = 0 || 1; // 1 ... correct > $str = 10 or 1; // 10 ... correct > $str = 0 or 1; // 0 > > > Either PHP doesn't support them well now, or its completely > broken! Any info? > > Perl reports: > > 10 ... correct > 1 ... correct > 10 ... correct > 0 ... correct, according to the precedence table, I reckon. > > Thank you! > > -- Faisal > > > -- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.version4 (#10442) next »