3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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.5.11
Parse error: syntax error, unexpected '}' in /in/Vn1vL on line 11
Process exited with code 255.