3v4l.org

run code in 150+ 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, 'name');
Output for 4.3.0 - 7.1.0
Happy birthday to you! Happy birthday to you! Happy birthday dear name! Happy birthday to you!