3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function perfect_time($time) { return strtotime($time) - time(); } function zone2time($zone_offset) { return @preg_match("/^([\\+\\-]{1})?([0-9]{1,2}):([0-9]{1,2})$/i", preg_replace("/[a-z\\s]+/", null, strtolower($zone_offset)), $out) ? perfect_time("{$out[2]} Hours {$out[3]} Mins" . ($out[1] === "-" ? " ago" : null)) : false; } var_dump(zone2time(" GMT 05 : 30 "));
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(19800)
Output for 5.0.0 - 5.0.2
int(-30289)