3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tries = array( 'CET', 'Europe/Madrid', date_default_timezone_get() ); foreach ($tries as $try) { $dtzone = new DateTimeZone($try); $dt = new DateTime(null, $dtzone); $dt->setDate(2015, 3, 25); $dt->setTime(10, 5, 0); var_dump($dt->getTimestamp()); }
based on C1DgG
Output for 5.3.0 - 7.2.0
int(1427274300) int(1427274300) int(1427274300)
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/lYcpr on line 15
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTimeZone' not found in /in/lYcpr on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_get() in /in/lYcpr on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_get() in /in/lYcpr on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_get() in /in/lYcpr on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_get() in /in/lYcpr on line 6