3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C1 { public function __construct($p) { $this->p = $p; } } class C2 { public function __construct(C1 $c) { $this->c = $c; } } $c1 = new C1(1); $c2 = new C2($c1); $c1 = new C1(2); var_dump($c2->c->p);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property C1::$p is deprecated in /in/FgjQI on line 4 Deprecated: Creation of dynamic property C2::$c is deprecated in /in/FgjQI on line 9 Deprecated: Creation of dynamic property C1::$p is deprecated in /in/FgjQI on line 4 int(1)

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:
45.32 ms | 402 KiB | 8 Q