3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ static $count = 0; public function __construct(){ $this->method('from constructor in object context ($this->)'); Test::method('from constructor in static context (Test::)'); self::method('from constructor in static context (self::)'); } public function __call($name, $arguments){ switch($name){ case 'method': self::magicMethod('__call() '.$arguments[0]); } } public static function __callStatic($name, $arguments){ switch($name){ case 'method': self::magicMethod('__callStatic() '.$arguments[0]); } } protected static function magicMethod($arg){ self::$count++; echo('Call '. self::$count.' : '.$arg."\n"); } protected function test(){ } } $test = new Test(); $test->method('from outside in object context ($this->)'); Test::method('from outside in static context (Test::)');
Output for git.master, git.master_jit, rfc.property-hooks
Call 1 : __call() from constructor in object context ($this->) Call 2 : __call() from constructor in static context (Test::) Call 3 : __call() from constructor in static context (self::) Call 4 : __call() from outside in object context ($this->) Call 5 : __callStatic() from outside in static context (Test::)

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