3v4l.org

run code in 300+ PHP versions simultaneously
<?php function call($name, $method, $args, $ref, $context, $class) { var_dump($name, $method, $context, $class); return call_user_func_array(array($name, $method), $args); } class Foo_2e0af02066baec452cc22d76d0dbe2d7 { public static function foo() { return call('static', 'bar', array(), array(), @get_called_class(), __CLASS__); } } class Foo_dd0a956520946526fec64c726f93ed58 extends Foo_2e0af02066baec452cc22d76d0dbe2d7 { protected static function bar() { return __CLASS__; } } echo call('Foo_dd0a956520946526fec64c726f93ed58', 'foo', array(), array(), @get_called_class(), __CLASS__);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: get_called_class() must be called from within a class in /in/2kcdG:23 Stack trace: #0 {main} thrown in /in/2kcdG on line 23
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:
41.29 ms | 401 KiB | 8 Q