3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private $f; public function __construct(&$f) { $this->f = &$f; } public function __destruct() { $this->f = function() {"Echo smart ass!\n"}; } } $f = function () use (&$f) { $t = new test($f); print "After this line it the Closure should be destroyed...\n"; }; $f(); $f(); var_dump($f);
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27, 5.5.0 - 5.5.11
Parse error: syntax error, unexpected '}' in /in/Vn1vL on line 11
Process exited with code 255.

preferences:
191.11 ms | 1395 KiB | 76 Q