3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = ''; for ($i = 0; $i < 4; $i++) { $string .= "Happy birthday "; if ($i != 2) { $string .= "to you!\n"; } else { $string .= "dear %s!\n"; } } print sprintf($string, 'Paul');
Output for 4.3.0 - 7.2.0
Happy birthday to you! Happy birthday to you! Happy birthday dear Paul! Happy birthday to you!