3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(sprintf("('1%1$\')", 'a')); var_dump(sprintf("('1%\')", 'a','b')); var_dump(sprintf("('1%ab", 'a','b')); var_dump(sprintf("('1%)a", 'a','b')); var_dump(sprintf("('1%'b", 'a','b'));
based on AOiLD
Output for 4.3.0 - 7.1.0
string(5) "('1')" string(5) "('1')" string(4) "('1b" string(4) "('1a" string(3) "('1"