3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { var $my_public = array(); //forward php4 to constructor function foo($one, $two) { $this->my_public[] = 'php4 constructor'; return $this->__construct($one, $two); } //constructor php5 function __construct($one, $two) { $this->my_public[] = 'php5 constructor'; $this->my_public[] = $one; $this->my_public[] = $two; register_shutdown_function(array(&$this, "__destruct")); } function dump() { print_r($this->my_public); } function __destruct () {} } $test = new foo('een', 'twee'); $test->dump();
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => php5 constructor [1] => een [2] => twee )

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:
42.15 ms | 401 KiB | 8 Q