Annotation of embedaddon/php/Zend/tests/bug39018.phpt, revision 1.1.1.3
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';
1.1.1.2 misho 9: $a[111111111111111111111];
1.1 misho 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--
1.1.1.3 ! misho 65: Notice: String offset cast occurred in %s on line %d
1.1 misho 66:
1.1.1.2 misho 67: Notice: Uninitialized string offset: 0 in %s on line %d
1.1 misho 68:
1.1.1.2 misho 69: Notice: Uninitialized string offset: 0 in %s on line %d
1.1 misho 70:
1.1.1.3 ! misho 71: Notice: String offset cast occurred in %s on line %d
1.1 misho 72:
1.1.1.2 misho 73: Notice: Uninitialized string offset: %i in %s on line %d
1.1 misho 74:
1.1.1.3 ! misho 75: Notice: String offset cast occurred in %s on line %d
1.1 misho 76:
1.1.1.2 misho 77: Notice: Uninitialized string offset: %i in %s on line %d
1.1 misho 78:
1.1.1.2 misho 79: Notice: Uninitialized string offset: 0 in %s on line %d
1.1 misho 80:
1.1.1.2 misho 81: Notice: Uninitialized string offset: 4 in %s on line %d
82:
83: Notice: Uninitialized string offset: 4 in %s on line %d
84:
85: Notice: Uninitialized string offset: 4 in %s on line %d
86:
87: Notice: Uninitialized string offset: 4 in %s on line %d
88:
89: Notice: Uninitialized string offset: 4 in %s on line %d
90:
1.1.1.3 ! misho 91: Notice: String offset cast occurred in %s on line %d
1.1.1.2 misho 92:
93: Notice: Uninitialized string offset: 12 in %s on line %d
94:
1.1.1.3 ! misho 95: Notice: String offset cast occurred in %s on line %d
1.1.1.2 misho 96:
97: Notice: Uninitialized string offset: 12 in %s on line %d
98:
1.1.1.3 ! misho 99: Notice: String offset cast occurred in %s on line %d
1.1.1.2 misho 100:
1.1.1.3 ! misho 101: Notice: String offset cast occurred in %s on line %d
1.1 misho 102: b
103: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>