xref: /PHP-7.2/Zend/tests/bug43201.phpt (revision 17ccbeec)
1--TEST--
2Bug #43201 (Crash on using uninitialized vals and __get/__set)
3--FILE--
4<?php
5class Foo {
6	function __get($k) {
7		return null;
8	}
9	function __set($k, $v) {
10		$this->$k = $v;
11	}
12}
13
14$c = new Foo();
15
16$c->arr[0]["k"] = 1;
17$c->arr[0]["k2"] = $ref;
18for($cnt=0;$cnt<6;$cnt++) {
19	$ref = chop($undef);
20	$c->arr[$cnt]["k2"] = $ref;
21}
22echo "ok\n";
23?>
24--EXPECTF--
25Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 13
26
27Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 14
28
29Notice: Undefined variable: ref in %sbug43201.php on line 14
30
31Notice: Undefined variable: undef in %sbug43201.php on line 16
32
33Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
34
35Notice: Undefined variable: undef in %sbug43201.php on line 16
36
37Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
38
39Notice: Undefined variable: undef in %sbug43201.php on line 16
40
41Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
42
43Notice: Undefined variable: undef in %sbug43201.php on line 16
44
45Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
46
47Notice: Undefined variable: undef in %sbug43201.php on line 16
48
49Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
50
51Notice: Undefined variable: undef in %sbug43201.php on line 16
52
53Notice: Indirect modification of overloaded property Foo::$arr has no effect in %sbug43201.php on line 17
54ok
55