3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EmptyObj{ protected function __construct(){} public static function get(){ static $obj; if(!$obj) $obj = new EmptyObj; return $obj; } public function __call($n, $a){ return $this; } } class SomeClass{ public $image; public function __construct(){ $this->image = EmptyObj::get(); }} $a = new SomeClass; echo $a->image->oopsForgotToSetImage();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Object of class EmptyObj could not be converted to string in /in/G3M4a:20 Stack trace: #0 {main} thrown in /in/G3M4a on line 20
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.22 ms | 401 KiB | 8 Q