3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo Module::work('hello world.'), "\n"; echo MyModule::work('hello world.'); abstract class Module { private static $mask = 'x[[[%s]]]'; public static function work($it) { return preg_replace_callback('~\w+~', array('static', 'static::replace'), $it); } private static function replace($matches) { return sprintf(self::$mask, $matches[0]); } } abstract class MyModule extends Module { protected static $mask = 'x{{{%s}}}'; protected static function replace($matches) { return sprintf(self::$mask, $matches[0]); } }
Output for git.master_jit, git.master, rfc.property-hooks
Deprecated: Use of "static" in callables is deprecated in /in/pp1M2 on line 10 Deprecated: Callables of the form ["Module", "static::replace"] are deprecated in /in/pp1M2 on line 10 x[[[hello]]] x[[[world]]]. Deprecated: Use of "static" in callables is deprecated in /in/pp1M2 on line 10 Deprecated: Callables of the form ["MyModule", "static::replace"] are deprecated in /in/pp1M2 on line 10 x{{{hello}}} x{{{world}}}.

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:
55.07 ms | 402 KiB | 8 Q