22 lines
298 B
Plaintext
22 lines
298 B
Plaintext
|
|
--TEST--
|
||
|
|
Bug #79477: casting object into array creates references
|
||
|
|
--FILE--
|
||
|
|
<?php
|
||
|
|
|
||
|
|
#[AllowDynamicProperties]
|
||
|
|
class Test {
|
||
|
|
public $prop = 'default value';
|
||
|
|
}
|
||
|
|
|
||
|
|
$obj = new Test;
|
||
|
|
$obj->{1} = null;
|
||
|
|
|
||
|
|
$arr = (array) $obj;
|
||
|
|
$arr['prop'] = 'new value';
|
||
|
|
|
||
|
|
echo $obj->prop, "\n";
|
||
|
|
|
||
|
|
?>
|
||
|
|
--EXPECT--
|
||
|
|
default value
|