3v4l.org

run code in 300+ PHP versions simultaneously
<?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';

preferences:
42.07 ms | 406 KiB | 5 Q