3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php sqlTemplate("{{1}} {[2]} {{3: BLABLABLA}}"); function sqlTemplate($query,$vars){ $replace = function($matches) use ($vars) { var_dump($matches,$vars); }; return preg_replace_callback('~\{([\[\{]\})[a-z0-9\_\-]+(\:([^}]))?[\]\}]\}~i',$replace, $query); }
Output for 7.1.0RC3 - 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function sqlTemplate(), 1 passed in /in/p26Ou on line 3 and exactly 2 expected in /in/p26Ou:5 Stack trace: #0 /in/p26Ou(3): sqlTemplate('{{1}} {[2]} {{3...') #1 {main} thrown in /in/p26Ou on line 5
Process exited with code 255.
Output for 7.1.0alpha2 - 7.1.0beta3
Fatal error: Uncaught Error: Too few arguments to function sqlTemplate(), 1 passed in /in/p26Ou on line 3 and exactly 2 expected in /in/p26Ou:5 Stack trace: #0 /in/p26Ou(3): sqlTemplate('{{1}} {[2]} {{3...') #1 {main} thrown in /in/p26Ou on line 5
Process exited with code 255.
Output for 5.3.0 - 5.6.25, 7.0.0 - 7.1.0alpha1
Warning: Missing argument 2 for sqlTemplate(), called in /in/p26Ou on line 3 and defined in /in/p26Ou on line 5 Notice: Undefined variable: vars in /in/p26Ou on line 6
Output for hhvm-3.10.0 - 3.12.0
Warning: sqlTemplate() expects exactly 2 parameters, 1 given in /in/p26Ou on line 8 Notice: Undefined variable: vars in /in/p26Ou on line 8
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/p26Ou on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/p26Ou on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/p26Ou on line 6
Process exited with code 255.