++ bug or unexpected behaviour
| From: | waldschrott | Date: | Sat, 10 Jun 2000 15:35:54 +0000 |
| Subject: | ++ bug or unexpected behaviour | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20917@lists.php.net to get a copy of this message | ||
I think "$t++" and "$t=$t+1" should produces the same results, shouldn´t they?
1) This does not work as expected, $t is not converted to an integer, although it does not contain any character.
<?php
$t=''; // $t=0; will help...
$t++;
print $t;
?>
2) This does work. $t++ replaced with $t=$t+1;
<?php
$t='';
$t=$t+1;
print $t;
?>
regards
--
o----------0-¬---------O-·---¬----o---®-----o o O ° .
| http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ °
·
0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ °
o © ° . ·
| psychedelic experience | gott@kiffen.de | O ° o °
o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·