3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a() { return get_called_class(); } class A { protected $a; public function foo() { $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/JTnDe:3 Stack trace: #0 /in/JTnDe(11): a() #1 /in/JTnDe(14): A->{closure}() #2 /in/JTnDe(19): A->foo() #3 {main} thrown in /in/JTnDe 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:
65.72 ms | 401 KiB | 8 Q