3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = 'test'; $line = "var1: %2$s, var2: %s"; echo sprintf($line, $arr);
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: s in /in/Uh8qc on line 3 Warning: sprintf(): Too few arguments in /in/Uh8qc on line 4
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: s in /in/Uh8qc on line 3 Warning: Invalid argument: arguments: (too few) in /in/Uh8qc on line 4
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: s in /in/Uh8qc on line 3 Warning: sprintf(): Too few arguments in /in/Uh8qc on line 4
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: s in /in/Uh8qc on line 3 Warning: sprintf() [http://www.php.net/function.sprintf]: Too few arguments in /in/Uh8qc on line 4