3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str_time = "2:50"; sscanf($str_time, "%d:%d:%d", $hours, $minutes, $seconds); $time_seconds = isset($seconds) ? $hours * 3600 + $minutes * 60 + $seconds : $hours * 60 + $minutes; echo $time_seconds;
Output for 5.3.19 - 7.2.0
170