php short circuit bug?
| From: | Pascal KISSIAN | Date: | Fri, 30 Sep 2016 10:45:27 +0000 |
| Subject: | php short circuit bug? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-96180@lists.php.net to get a copy of this message | ||
Hi everybody,
Perhaps am I making a mistake, but the following code fragment:
<?php
$t_aa = array();
if ( !isset($t_aa["bb"]) || ($t_aa["bb"]=="") )
$t_aa["bb"]=="cc";
?>
Emits the following notice:
PHP Notice: Undefined index: bb in test.php on line 4
The php documentation :
http://php.net/manual/en/language.operators.logical.php
states in exemple 1 that short circuit is implemented.
In my example as !isset($t_aa["bb"]) true, then the second expression
($t_aa["bb"]=="")should not be evaluated!
Is it a php bug? Or am i missing something?
Cheers,
Pascal KISSIAN