3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private static $i = 0; public $flag; public function __construct() { $this->foo = ++$this->i; return false; } public function setFlag() { $this->flag = 1; } } $one = new A(); $one->setFlag(); var_dump($one); $two = new A(); var_dump($two); $thr = $one->__construct(); var_dump($thr); $fou = $two->__construct(); var_dump($fou);
Output for git.master, git.master_jit, rfc.property-hooks
Notice: Accessing static property A::$i as non static in /in/tMAfO on line 12 Deprecated: Creation of dynamic property A::$i is deprecated in /in/tMAfO on line 12 Warning: Undefined property: A::$i in /in/tMAfO on line 12 Deprecated: Creation of dynamic property A::$foo is deprecated in /in/tMAfO on line 12 object(A)#1 (3) { ["flag"]=> int(1) ["i"]=> int(1) ["foo"]=> int(1) } Notice: Accessing static property A::$i as non static in /in/tMAfO on line 12 Deprecated: Creation of dynamic property A::$i is deprecated in /in/tMAfO on line 12 Warning: Undefined property: A::$i in /in/tMAfO on line 12 Deprecated: Creation of dynamic property A::$foo is deprecated in /in/tMAfO on line 12 object(A)#2 (3) { ["flag"]=> NULL ["i"]=> int(1) ["foo"]=> int(1) } Notice: Accessing static property A::$i as non static in /in/tMAfO on line 12 bool(false) Notice: Accessing static property A::$i as non static in /in/tMAfO on line 12 bool(false)

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:
53.18 ms | 403 KiB | 8 Q