Re: [PHP4BETA] broken or probably not implement!
| From: | Hartmut Holzgraefe | Date: | Fri, 18 Feb 2000 13:11:44 +0000 |
| Subject: | Re: [PHP4BETA] broken or probably not implement! | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10447@lists.php.net to get a copy of this message | ||
Faisal Nasim wrote:
> : 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
>
> Then why:
>
> $str = 10 or 1 // = 10
> and
> $str = 0 or 1 // = 0
>
> 0 is false, and 'or' has low precedence, so result should be 1!
>
or is so 'weak' that your statement above is equivalent to
( $str = 0 ) or 1
although you wanted
$str = ( 0 or 1 ) // =1
--
Hartmut Holzgraefe hartmut@six.de http://www.six.de
Besuchen Sie Six auf der CeBIT (24.2.-1.3.) in Halle 10, Stand 425,
und auf der Hannover-Messe (20.-25.3.) in Halle 14, Stand J50!