3v4l.org

run code in 300+ PHP versions simultaneously
<?php // https://gist.github.com/TazeTSchnitzel/33cf828bfa306b1b1d2187a6de639375 function fn(&$obj) { return new class($obj) { private $obj; public function __construct(&$obj) { $this->obj = &$obj; } public function __call(string $fn_name, array $fn_args):self { $this->obj = $fn_name(...$fn_args); return $this; } }; } $nama = 'anovsiradj'; echo $nama, PHP_EOL; fn($nama) ->str_replace('a', '4', $nama) ->str_replace('i', '1', $nama) ->str_replace('o', '0', $nama) ->str_rot13($nama) ->md5($nama); echo $nama;
Output for git.master, git.master_jit, rfc.property-hooks
Parse error: syntax error, unexpected token "fn", expecting "(" in /in/u0TEq on line 4
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:
25.86 ms | 405 KiB | 5 Q