3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private static $i = 0; public $flag; public function __construct() { $this->foo = ++self::$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
Deprecated: Creation of dynamic property A::$foo is deprecated in /in/IA11r on line 12 object(A)#1 (2) { ["flag"]=> int(1) ["foo"]=> int(1) } Deprecated: Creation of dynamic property A::$foo is deprecated in /in/IA11r on line 12 object(A)#2 (2) { ["flag"]=> NULL ["foo"]=> int(2) } bool(false) 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:
55.01 ms | 401 KiB | 8 Q