php-src/Zend/tests/bug70397.phpt
Nikita Popov 902d64390e Deprecate implicit dynamic properties
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
2021-11-26 14:10:11 +01:00

18 lines
255 B
PHP

--TEST--
Bug #70397 (Segmentation fault when using Closure::call and yield)
--FILE--
<?php
$f = function () {
$this->value = true;
yield $this->value;
};
var_dump($f->call(new class {
public $value;
})->current());
?>
--EXPECT--
bool(true)