3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doSth($c) { $c(); } class foo { private static function bar() { echo 'OK'; } public static function go() { doSth(function() { $self = $this; $self::bar(); }); } } foo::go();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Using $this when not in object context in /in/GHipZ:19 Stack trace: #0 /in/GHipZ(5): foo::{closure}() #1 /in/GHipZ(17): doSth(Object(Closure)) #2 /in/GHipZ(25): foo::go() #3 {main} thrown in /in/GHipZ on line 19
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.91 ms | 405 KiB | 9 Q