3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { protected static $property = 'foo'; public function method() { echo self::$property . "\n"; } } class Child extends Base { } echo "base1\n"; $base1 = new Base(); $base1->method(); Base::$property = 'bar'; echo "child\n"; $child = new Child(); $child->method(); echo "base2\n"; $base2 = new Base(); $base2->method();
Output for git.master, git.master_jit, rfc.property-hooks
base1 foo Fatal error: Uncaught Error: Cannot access protected property Base::$property in /in/BFZ2S:15 Stack trace: #0 {main} thrown in /in/BFZ2S on line 15
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:
46.77 ms | 401 KiB | 8 Q