3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait Foo { function test() { var_dump( $this->whatever() ); } } class A { use Foo; public function whatever() { return 42; } } class B { use Foo; private function whatever() { return 'hello'; } } class C { use Foo; } (new A)->test(); (new B)->test(); (new C)->test();
Output for git.master_jit, git.master
int(42) string(5) "hello" Fatal error: Uncaught Error: Call to undefined method C::whatever() in /in/QIPsL:5 Stack trace: #0 /in/QIPsL(29): C->test() #1 {main} thrown in /in/QIPsL on line 5
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:
47.81 ms | 776 KiB | 4 Q