3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public function __destruct() { echo 'destructed', PHP_EOL; } } $x = new C(); $fn = fn ($a, $b) => (($x = $a ** 2) + ($y = $b ** 2)) * ($x - $y); echo '- unsetting $x', PHP_EOL; unset($x); echo '- calling $fn', PHP_EOL; var_dump($fn(3, 2)); echo '- unsetting $fn', PHP_EOL; unset($fn); echo '- DONE.', PHP_EOL;

preferences:
23.87 ms | 404 KiB | 5 Q