3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'previous 22:30'; date_default_timezone_set('UTC'); var_dump(strtotime($str)); var_dump('22 ' . date('r', strtotime($str, time()))); var_dump('22 ' . date('r', strtotime($str, strtotime('2013-05-23 00:30')))); var_dump('22 ' . date('r', strtotime($str, strtotime('2013-05-22 23:30')))); var_dump('?? ' . date('r', strtotime($str, strtotime('2013-05-22 22:30')))); var_dump('21 ' . date('r', strtotime($str, strtotime('2013-05-22 21:00'))));
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(false) string(34) "22 Thu, 01 Jan 1970 00:00:00 +0000" string(34) "22 Thu, 01 Jan 1970 00:00:00 +0000" string(34) "22 Thu, 01 Jan 1970 00:00:00 +0000" string(34) "?? Thu, 01 Jan 1970 00:00:00 +0000" string(34) "21 Thu, 01 Jan 1970 00:00:00 +0000"
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/t0oie on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/t0oie on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/t0oie on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/t0oie on line 3