3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function test() {echo __METHOD__ . "\n";} public static function testStatic() {echo __METHOD__ . "\n";} } class MyClass2 extends MyClass { public function test() {echo __METHOD__ . "\n"; call_user_func('parent::test'); } public static function testStatic() {echo __METHOD__ . "\n"; call_user_func('parent::testStatic'); call_user_func('static::testLate');} } class MyClass3 extends MyClass2 { public static function testLate() {echo __METHOD__ . "\n";} } echo "call object method:\n"; $o = new MyClass3(); $o->test(); $o->testStatic(); echo "call static method:\n"; MyClass3::testStatic();
Output for git.master, git.master_jit, rfc.property-hooks
call object method: MyClass2::test Deprecated: Use of "parent" in callables is deprecated in /in/EBSib on line 9 MyClass::test MyClass2::testStatic Deprecated: Use of "parent" in callables is deprecated in /in/EBSib on line 10 MyClass::testStatic Deprecated: Use of "static" in callables is deprecated in /in/EBSib on line 10 MyClass3::testLate call static method: MyClass2::testStatic Deprecated: Use of "parent" in callables is deprecated in /in/EBSib on line 10 MyClass::testStatic Deprecated: Use of "static" in callables is deprecated in /in/EBSib on line 10 MyClass3::testLate

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