3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class _ { private function __destruct() {new self;} } class __ { private $f; public function __construct(&$f) { $this->f = &$f; } public function __destruct() { $this->f = function(){new _;}; } } $f = function () use (&$f) { $t = new __($f); echo "All is good"; }; $f(); $f();
Output for 5.4.0 - 5.4.27
All is good Fatal error: Call to private _::__destruct() from context '__' in /in/puQYJ on line 18
Process exited with code 255.
Output for 5.3.0 - 5.3.28
All is good Fatal error: Call to private _::__destruct() from context '' in /in/puQYJ on line 18
Process exited with code 255.