3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a() { $f = function() { return get_called_class(); }; return $f(); } class A { protected $a; public function foo() { set_error_handler(function() {}); get_called_class(); restore_error_handler(); $f = function() { echo a(); }; $f(); } } $a = new A; $a->foo();
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/TedjM:3 Stack trace: #0 /in/TedjM(4): {closure}() #1 /in/TedjM(15): a() #2 /in/TedjM(18): A->{closure}() #3 /in/TedjM(23): A->foo() #4 {main} thrown in /in/TedjM on line 3
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.75 ms | 401 KiB | 8 Q