3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'yesterday 22:30'; date_default_timezone_set('UTC'); 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
string(33) "22Wed, 22 May 2013 22:30:00 +0000" string(33) "22Wed, 22 May 2013 22:30:00 +0000" string(33) "22Tue, 21 May 2013 22:30:00 +0000" string(33) "??Tue, 21 May 2013 22:30:00 +0000" string(33) "21Tue, 21 May 2013 22:30:00 +0000"
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/KeVhE 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/KeVhE 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/KeVhE 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/KeVhE on line 3