3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $seconds = 2434; $h = $seconds / 3600 % 24; $m = $seconds / 60 % 60; $s = $seconds % 60; $hours = '00'; $minutes = '00'; $seconds = '00'; if ($h > 0){ if (strlen(strval($h)) == 1){ $hours = '0'.strval($h); } else {$hours = strval($h)} } if ($m > 0){ if (strlen(strval($m)) == 1){ $minutes = '0'.strval($m); } else {$minutes = strval($m)} } if ($s > 0){ if (strlen(strval($s)) == 1){ $seconds = '0'.strval($s); } else {$seconds = strval($s)} } $time = $hours.":".$minutes.":".$seconds; echo "\$h: ", $h, " \n"; echo "\$m: ", $m, " \n"; echo "\$s: ", $s, " \n"; echo $time;
Output for 5.3.0 - 5.4.19
Parse error: syntax error, unexpected '}' in /in/bnnVb on line 13
Process exited with code 255.