3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { public $hidden; function __call($name, $arguments) { echo 'hello from overload'; } function destruct() { unset($this); } } class Bar { use Foo; function hello() { echo 'hello from bar'; } } class Cheese { static function deleteMe($obj) { $obj->destruct(); } } $foo = new Bar(); Cheese::deleteMe($foo); gc_collect_cycles(); $foo->hello();

preferences:
36.47 ms | 402 KiB | 5 Q