3v4l.org

run code in 200+ php & hhvm versions
<?php $timezone_string1 = 'America/Regina'; $timezone_string2 = 'Europe/Zurich'; $summer = '2012-06-01 00:00:00'; $winter = '2012-12-01 00:00:00'; $format = 'Y-m-d H:i:s T P e'; echo "Summer: $summer\n"; $timezone_object = timezone_open( $timezone_string1 ); $date_object_summer = date_create( $summer, $timezone_object ); var_dump( date_format( $date_object_summer, $format ) ); $timezone_object = timezone_open( $timezone_string2 ); $date_object_summer = date_create( $summer, $timezone_object ); var_dump( date_format( $date_object_summer, $format ) ); echo "\nWinter: $winter\n"; $timezone_object = timezone_open( $timezone_string1 ); $date_object_winter = date_create( $winter, $timezone_object ); var_dump( date_format( $date_object_winter, $format ) ); $timezone_object = timezone_open( $timezone_string2 ); $date_object_winter = date_create( $winter, $timezone_object ); var_dump( date_format( $date_object_winter, $format ) );
Output for 5.2.0 - 7.3.1
Summer: 2012-06-01 00:00:00 string(45) "2012-06-01 00:00:00 CST -06:00 America/Regina" string(45) "2012-06-01 00:00:00 CEST +02:00 Europe/Zurich" Winter: 2012-12-01 00:00:00 string(45) "2012-12-01 00:00:00 CST -06:00 America/Regina" string(44) "2012-12-01 00:00:00 CET +01:00 Europe/Zurich"
Output for 5.0.0 - 5.1.6
Summer: 2012-06-01 00:00:00 Fatal error: Call to undefined function timezone_open() in /in/L59eg on line 11
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Summer: 2012-06-01 00:00:00 Fatal error: Call to undefined function: timezone_open() in /in/L59eg on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Summer: 2012-06-01 00:00:00 Fatal error: Call to undefined function: timezone_open() in /in/L59eg on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Summer: 2012-06-01 00:00:00 Fatal error: Call to undefined function: timezone_open() in /in/L59eg on line 11