3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private function doFoo() { echo 'yes'; } public function doBar() { $cb = [rand(0,1) ? 'Bar' : $this, 'doFoo']; $cb(); $cb = [rand(0,1) ? 'Bar' : $this, 'doFoo']; $cb(); $cb = [rand(0,1) ? 'Bar' : $this, 'doFoo']; $cb(); } } $b = new Bar(); $b->doBar();
Output for git.master, rfc.property-hooks, git.master_jit
Fatal error: Uncaught Error: Non-static method Bar::doFoo() cannot be called statically in /in/UiCIl:13 Stack trace: #0 /in/UiCIl(22): Bar->doBar() #1 {main} thrown in /in/UiCIl on line 13
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.05 ms | 2758 KiB | 4 Q