note 3623 deleted from Strings by ronabop
| From: | ronabop@php.net | Date: | Mon, 02 Oct 2000 11:52:44 +0000 |
| Subject: | note 3623 deleted from Strings by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-5948@lists.php.net to get a copy of this message | ||
<pre>
<?
$a=5;
$b='foo';
if ($a<$b) echo 'false cause 5>0';
if ($b<$a) echo 'false cause "5">"foo"';
?>
</pre>
Why in $b was converted to integer in second if? If operator < is left-to-right then second
operand must be costed to first operand type? Or not? If we use arithmetic operators like + or - ok
we shoul treat strings as integers but condition operators are valid for strints too. Please
NOTE/EXPLAIN this situation in dox ;-)