- str_repeat: documentation ( source)
- register_shutdown_function: documentation ( source)
- ini_set: documentation ( source)
<?php
ini_set("memory_limit", "5M");
class Foo {
public function __set($prop, $value) {
echo "__set($prop, $value)\n";
if ($value == "bar") {
str_repeat("a", 1e7);
}
}
}
$foo = new Foo();
register_shutdown_function(function() use ($foo) {
$foo->bar = 'baz';
});
$foo->bar = 'bar';