Annotation of embedaddon/php/Zend/tests/bug39018.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #39018 (Error control operator '@' fails to suppress "Uninitialized string offset")
! 3: --FILE--
! 4: <?php
! 5:
! 6: error_reporting(E_ALL);
! 7:
! 8: $a = 'foo';
! 9: $a[11111111111];
! 10:
! 11: $a = '';
! 12:
! 13: $a[0];
! 14:
! 15: print $a[0]; // 12
! 16:
! 17: $a[-11111111111111111111111];
! 18:
! 19: print $a[-11111111111111111111111]; // 16
! 20:
! 21: $a[-0];
! 22:
! 23: $x = 'test';
! 24:
! 25: @$x[4];
! 26:
! 27: @$y = $x[4];
! 28:
! 29: @('a' == $x[4]);
! 30:
! 31: $x[4] == 'a'; // 28
! 32:
! 33: @$x[4] == 'a';
! 34:
! 35: (@$x[4]) == 'a';
! 36:
! 37: ($x[4]) == 'a'; // 34
! 38:
! 39: (@($x[4])) == 'a';
! 40:
! 41: (($x[4])) == 'a'; // 38
! 42:
! 43: @($x[4]) == 'a';
! 44:
! 45: ($x[4]) == 'a'; // 42
! 46:
! 47: @($x[4] == 'a');
! 48:
! 49: ($x[4] == 'a'); // 46
! 50:
! 51: $y = 'foobar';
! 52:
! 53: $y[12.2];
! 54:
! 55: print $y[12.2]; // 52
! 56:
! 57: $y[3.5];
! 58:
! 59: print $y[3.5]; // 56
! 60:
! 61: print "\nDone\n";
! 62:
! 63: ?>
! 64: --EXPECTF--
! 65:
! 66: Notice: Uninitialized string offset: 0 in %s on line 12
! 67:
! 68: Notice: Uninitialized string offset: %i in %s on line 16
! 69:
! 70: Notice: Uninitialized string offset: 4 in %s on line 28
! 71:
! 72: Notice: Uninitialized string offset: 4 in %s on line 34
! 73:
! 74: Notice: Uninitialized string offset: 4 in %s on line 38
! 75:
! 76: Notice: Uninitialized string offset: 4 in %s on line 42
! 77:
! 78: Notice: Uninitialized string offset: 4 in %s on line 46
! 79:
! 80: Notice: Uninitialized string offset: 12 in %s on line 52
! 81: b
! 82: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>