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