xref: /PHP-8.1/Zend/tests/bug79477.phpt (revision 682e2f6c)
1--TEST--
2Bug #79477: casting object into array creates references
3--FILE--
4<?php
5
6class Test {
7    public $prop = 'default value';
8}
9
10$obj = new Test;
11$obj->{1} = null;
12
13$arr = (array) $obj;
14$arr['prop'] = 'new value';
15
16echo $obj->prop, "\n";
17
18?>
19--EXPECT--
20default value
21