xref: /PHP-7.3/Zend/tests/bug75420.15.phpt (revision 98eee907)
1--TEST--
2Bug #75420.15 (Indirect modification of magic method argument)
3--FILE--
4<?php
5class Test implements ArrayAccess {
6	public function offsetExists($x) { }
7	public function offsetGet($x) { }
8	public function offsetSet($x, $y) { $GLOBALS["name"] = 24; var_dump($x); }
9	public function offsetUnset($x) { }
10}
11
12$obj = new Test;
13$name = "foo";
14$name = str_repeat($name, 2);
15$obj[$name] = 1;
16var_dump($name);
17?>
18--EXPECT--
19string(6) "foofoo"
20int(24)
21