Hello, I have interesting problem when I trying to validate value. The code is valid and works white-out any errors, however result is wrong. Code: <?php $s='12345'; $i=false; if(isset($s)&&($s+=0)>0&&isset($s[4])&&!isset($s[5])){$i=true;}//$i must be true, but its not! ?> PHP: $i must be true, but its false. If we separate validation we will get true in all tests: <?php $i=''; $s='12345'; if(isset($s)){$i.=1;} $s='12345'; if(($s+=0)>0){$i.=1;} $s='12345'; if(isset($s[4])){$i.=1;} $s='12345'; if(!isset($s[5])){$i.=1;} echo $i; ?> PHP: outputs 1111 Is this happens only for me? Thanks.
I mean what this code is 100% valid, but it doesn't work: if(isset($s)&&($s+=0)>0&&isset($s[4])&&!isset($s[5])){$i=true;} PHP: