mirror of
https://github.com/php/php-src.git
synced 2026-04-23 07:58:20 +02: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
21 lines
319 B
PHP
21 lines
319 B
PHP
--TEST--
|
|
Bug #78379.2 (Cast to object confuses GC, causes crash)
|
|
--FILE--
|
|
<?php
|
|
#[AllowDynamicProperties]
|
|
class E {}
|
|
function f() {
|
|
$e1 = new E;
|
|
$e2 = new E;
|
|
$a = ['e2' => $e2];
|
|
$e1->a = (object)$a;
|
|
$e2->e1 = $e1;
|
|
$e2->a = (object)$a;
|
|
}
|
|
f();
|
|
gc_collect_cycles();
|
|
echo "End\n";
|
|
?>
|
|
--EXPECT--
|
|
End
|