3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function perfect_time($time) { return strtotime($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 5.6.28, 7.0.14 - 7.1.0
int(1394648667)
Output for 7.0.6
int(1462281259)
Output for 7.0.5
int(1459649169)
Output for 7.0.4
int(1457617127)
Output for 7.0.3
int(1458310557)
Output for 7.0.2
int(1458677382)
Output for 7.0.1
int(1458780889)
Output for 7.0.0
int(1459042046)
Output for 5.6.21
int(1462178147)
Output for 5.6.20
int(1460250176)
Output for 5.6.19
int(1457387201)
Output for 5.6.18
int(1458020464)
Output for 5.6.17
int(1458412281)
Output for 5.6.16
int(1459134769)
Output for 5.6.15
int(1459225079)
Output for 5.6.14
int(1459579133)
Output for 5.6.13
int(1460716399)
Output for 5.6.12
int(1461111469)
Output for 5.6.11
int(1461396104)
Output for 5.6.10
int(1461575131)
Output for 5.6.9
int(1461765804)
Output for 5.6.8
int(1461967702)
Output for 5.5.35
int(1463919534)
Output for 5.5.34
int(1460344993)
Output for 5.5.33
int(1457484221)
Output for 5.5.32
int(1458199446)
Output for 5.5.31
int(1458508632)
Output for 5.5.30
int(1459491220)
Output for 5.5.29
int(1460853521)
Output for 5.5.28
int(1461208974)
Output for 5.5.27
int(1461304364)
Output for 5.5.26
int(1461670340)
Output for 5.5.25
int(1461865819)
Output for 5.5.24
int(1464052276)
Output for 5.4.45
int(1445046498)
Output for 5.4.41 - 5.4.44
int(1445046499)
Output for 5.4.37 - 5.4.40
int(1445046500)
Output for 5.4.34 - 5.4.36
int(1445046501)
Output for 5.4.29 - 5.4.32
int(1445046502)
Output for 5.4.25 - 5.4.28
int(1445046503)
Output for 5.4.22 - 5.4.24
int(1445046504)
Output for 5.4.18 - 5.4.21
int(1445046505)
Output for 5.4.14 - 5.4.17
int(1445046506)
Output for 5.4.10 - 5.4.13
int(1445046507)
Output for 5.4.7 - 5.4.9
int(1445046508)
Output for 5.4.3 - 5.4.6
int(1445046509)
Output for 5.4.0 - 5.4.2
int(1445046510)
Output for 5.3.26 - 5.3.29
int(1445046511)
Output for 5.3.23 - 5.3.25
int(1445046512)
Output for 5.3.19 - 5.3.22
int(1445046513)
Output for 5.3.15 - 5.3.18
int(1445046514)
Output for 5.3.12 - 5.3.14
int(1445046515)
Output for 5.3.8 - 5.3.11
int(1445046516)
Output for 5.3.4 - 5.3.7
int(1445046517)
Output for 5.2.16 - 5.3.3
int(1445046518)
Output for 5.2.10 - 5.2.15
int(1445046519)
Output for 5.2.6 - 5.2.9
int(1445046520)
Output for 5.2.1 - 5.2.5
int(1445046521)
Output for 5.1.3 - 5.2.0
int(1445046522)
Output for 5.0.3 - 5.1.2
int(1445046523)
Output for 5.0.0 - 5.0.2
int(1444966200)
Output for 4.4.5 - 4.4.9
int(1445046524)
Output for 4.3.9 - 4.4.4
int(1445046525)
Output for 4.3.0 - 4.3.8
int(1445046526)