mirror of
https://github.com/php/php-src.git
synced 2024-12-17 22:09:12 +08:00
902d64390e
Writing to a proprety that hasn't been declared is deprecated, unless the class uses the #[AllowDynamicProperties] attribute or defines __get()/__set(). RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
18 lines
297 B
PHP
18 lines
297 B
PHP
--TEST--
|
|
Bug #55305 (ref lost: 1st ref instantiated in class def, 2nd ref made w/o instantiating)
|
|
--FILE--
|
|
<?php
|
|
#[AllowDynamicProperties]
|
|
class Foo {
|
|
var $foo = "test";
|
|
}
|
|
|
|
$f = new Foo();
|
|
$f->bar =& $f->foo;
|
|
var_dump($f->foo);
|
|
var_dump($f->bar);
|
|
?>
|
|
--EXPECT--
|
|
string(4) "test"
|
|
string(4) "test"
|