Annotation of embedaddon/php/Zend/tests/bug44660.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #44660 (Indexed and reference assignment to propery of non-object don't trigger warning)
                      3: --FILE--
                      4: <?php
                      5: $s = "hello";
                      6: $a = true;
                      7: 
                      8: echo "--> read access: ";
                      9: echo $a->p;
                     10: 
                     11: echo "\n--> direct assignment: ";
                     12: $a->p = $s;
                     13: 
                     14: echo "\n--> increment: ";
                     15: $a->p++;
                     16: 
                     17: echo "\n--> reference assignment:";
                     18: $a->p =& $s;
                     19: 
                     20: echo "\n--> reference assignment:";
                     21: $s =& $a->p;
                     22: 
                     23: echo "\n--> indexed assignment:";
                     24: $a->p[0] = $s;
                     25: 
                     26: echo "\n--> Confirm assignments have had no impact:\n";
                     27: var_dump($a);
                     28: ?>
                     29: --EXPECTF--
                     30: --> read access: 
                     31: Notice: Trying to get property of non-object in %sbug44660.php on line 6
                     32: 
                     33: --> direct assignment: 
                     34: Warning: Attempt to assign property of non-object in %sbug44660.php on line 9
                     35: 
                     36: --> increment: 
                     37: Warning: Attempt to increment/decrement property of non-object in %sbug44660.php on line 12
                     38: 
                     39: --> reference assignment:
                     40: Warning: Attempt to modify property of non-object in %sbug44660.php on line 15
                     41: 
                     42: --> reference assignment:
                     43: Warning: Attempt to modify property of non-object in %sbug44660.php on line 18
                     44: 
                     45: --> indexed assignment:
                     46: Warning: Attempt to modify property of non-object in %sbug44660.php on line 21
                     47: 
                     48: --> Confirm assignments have had no impact:
                     49: bool(true)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>