3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = '13-09-2010 00:00:00'; date_default_timezone_set('IST'); $etc = (strtotime($date) * 1000) - (strtotime('02-01-1970 00:00:00') * 1000); echo $etc; echo "\n---------------------------------------------------------------------\n"; $str = strtotime($date); //Wed Oct 13 2010 05:30:00 GMT+0530 $ab = date("D M j Y G:i:s T", strtotime('02-01-1970 00:00:00')); echo $ab; echo "\n---------------------------------------------------------------------\n"; $datetime = new DateTime('Fri Jan 2 1970 0:00:00 UTC', new DateTimeZone('Asia/Calcutta')); $datetime->setTimezone(new DateTimeZone('Asia/Calcutta')); print $datetime->format('Y-m-d H:i:s (e)'); echo "\n---------------------------------------------------------------------\n"; $cur_time=date("Y-m-d H:i:s"); $curDate = '02-01-1970'; $input = array(1,7,3,5,9,2); $duration='+"echo array_rand($input, 1);"' minutes'; echo date('Y-m-d H:i:s', strtotime($duration, strtotime($curDate)));
based on QvtEP
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.2.0
Parse error: syntax error, unexpected 'minutes' (T_STRING) in /in/ruvvr on line 27
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: syntax error, unexpected T_STRING in /in/ruvvr:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: syntax error, unexpected T_STRING in /in/ruvvr:27 Stack trace: #0 {main}
Process exited with code 255.