3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { var $my_public = array(); //forward php4 to constructor function foo() { $this->my_public[] = 'php4 constructor'; return $this->__construct(); } //constructor php5 function __construct() { $this->my_public[] = 'php4 constructor'; register_shutdown_function(array(&$this, "__destruct")); } function dump() { print_r($this->my_public); } } $test = new foo();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class foo does not have a method "__destruct" in /in/XOEOu:19 Stack trace: #0 /in/XOEOu(19): register_shutdown_function(Array) #1 /in/XOEOu(29): foo->__construct() #2 {main} thrown in /in/XOEOu on line 19
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:
37.06 ms | 401 KiB | 8 Q