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() { echo 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
1 Fatal error: Uncaught Error: get_called_class() must be called from within a class in /in/WjGpR:3 Stack trace: #0 /in/WjGpR(4): {closure}() #1 /in/WjGpR(13): a() #2 /in/WjGpR(16): A->{closure}() #3 /in/WjGpR(21): A->foo() #4 {main} thrown in /in/WjGpR 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:
42.62 ms | 401 KiB | 8 Q