3v4l.org

run code in 300+ PHP versions simultaneously
<?php class BaseExample { public static function __callStatic($name, array $arguments) { echo "Calling static method '$name' \n"; } public function __call($name, array $arguments) { echo "Calling object method '$name' \n"; } } class Example extends BaseExample { public function __construct() { BaseExample::test1(); Example::test2(); static::test3(); self::test4(); $this->test5(); test(); } } $u = new Example(); Example::test8(); $u->test9(); function test() { Example::test6(); $this->test7(); }
Output for git.master, git.master_jit, rfc.property-hooks
Calling object method 'test1' Calling object method 'test2' Calling object method 'test3' Calling object method 'test4' Calling object method 'test5' Calling static method 'test6' Fatal error: Uncaught Error: Using $this when not in object context in /in/d6Chc:35 Stack trace: #0 /in/d6Chc(23): test() #1 /in/d6Chc(28): Example->__construct() #2 {main} thrown in /in/d6Chc on line 35
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:
42.04 ms | 401 KiB | 8 Q