3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //echo sprintf("CONCAT(product.%1s, (case when product.%1s != '' then CONCAT(' - ',product.%1s) else '' end), (case when product.%1s != '' then CONCAT(' - ',product.%1s) else '' end))", "name"); echo sprintf("CONCAT(product.%1$s, (case when product.%2$s != '' then CONCAT(' - ',product.%2$s) else '' end), (case when product.size != '' then CONCAT(' - ',product.size) else '' end))", "name", "color");
Output for 5.0.4 - 7.2.0
Notice: Undefined variable: s in /in/0mKHX on line 4 Notice: Undefined variable: s in /in/0mKHX on line 4 Notice: Undefined variable: s in /in/0mKHX on line 4 Warning: sprintf(): Too few arguments in /in/0mKHX on line 4
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: s in /in/0mKHX on line 4 Notice: Undefined variable: s in /in/0mKHX on line 4 Notice: Undefined variable: s in /in/0mKHX on line 4 Warning: sprintf(): Too few arguments in /in/0mKHX on line 4
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: s in /in/0mKHX on line 4 Notice: Undefined variable: s in /in/0mKHX on line 4 Notice: Undefined variable: s in /in/0mKHX on line 4 Warning: sprintf() [http://www.php.net/function.sprintf]: Too few arguments in /in/0mKHX on line 4