3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class P { abstract protected $foo { get; } } class C1 extends P { protected $foo = 1; } class C2 extends P { protected $foo = 2; static function foo($c) { return $c->foo; } } var_dump(C2::foo(new C2)); var_dump(C2::foo(new C1));
Output for git.master
int(2) Fatal error: Uncaught Error: Cannot access protected property C1::$foo in /in/7Xf05:14 Stack trace: #0 /in/7Xf05(18): C2::foo(Object(C1)) #1 {main} thrown in /in/7Xf05 on line 14
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:
136.33 ms | 1002 KiB | 7 Q