mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00: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
25 lines
431 B
PHP
25 lines
431 B
PHP
--TEST--
|
|
Bug #81104: Warning: "Failed to set memory limit to ... bytes" emitted after exit in debug
|
|
--INI--
|
|
memory_limit=5M
|
|
report_memleaks=0
|
|
--FILE--
|
|
<?php
|
|
#[AllowDynamicProperties]
|
|
class X {
|
|
public $x;
|
|
public function __construct() { $this->x = [$this]; }
|
|
}
|
|
gc_disable();
|
|
ini_set('memory_limit', '10M');
|
|
$y = [];
|
|
for ($i = 0; $i < 10000; $i++) {
|
|
$y[] = new X();
|
|
}
|
|
$y[0]->y = &$y;
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|