3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function myprelog(string $content, ...$args) { mylog($content, $args); } function mylog(string $msg, ...$args) { echo vsprintf($msg, $args); } myprelog('test %s %s', 'abc', 'def');
based on 9Cehe
Output for 7.0.0 - 7.3.0beta1
Notice: Array to string conversion in /in/DPKR6 on line 9 Warning: vsprintf(): Too few arguments in /in/DPKR6 on line 9
Output for hhvm-3.15.4
Notice: Array to string conversion in /in/DPKR6 on line 9 Warning: Invalid argument: arguments: (too few) in /in/DPKR6 on line 9
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to myprelog() must be an instance of string, string given, called in /in/DPKR6 on line 12 and defined in /in/DPKR6 on line 3
Process exited with code 255.