3v4l.org

run code in 300+ PHP versions simultaneously
<?php class First { public function test1() { echo get_called_class(); } public function test2() { print_r(debug_backtrace()); } public function test3() { echo get_class($this); } public function test4() { echo __CLASS__; } public static function test5() { echo get_called_class(); } } class_alias('First', 'Second'); $aliased = new Second(); $aliased->test1(); // First $aliased->test2(); // array( 0 => array( ... [object] => First Object, ... ) ) $aliased->test3(); // First $aliased->test4(); // First Second::test5(); // First
Output for git.master, git.master_jit, rfc.property-hooks
FirstArray ( [0] => Array ( [file] => /in/IpKVc [line] => 13 [function] => test2 [class] => First [object] => First Object ( ) [type] => -> [args] => Array ( ) ) ) FirstFirstFirst

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:
16.58 ms | 406 KiB | 5 Q