3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Voodoo {} class Alpha extends Voodoo { protected $x = 3; } class Beta extends Voodoo { public function seeX(Alpha $alpha) { return $alpha->x; } } $a = new Alpha; $b = new Beta; var_dump($b->seeX($a));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Cannot access protected property Alpha::$x in /in/02rQ2:9 Stack trace: #0 /in/02rQ2(15): Beta->seeX(Object(Alpha)) #1 {main} thrown in /in/02rQ2 on line 9
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:
47.45 ms | 2718 KiB | 4 Q