3v4l.org

run code in 300+ PHP versions simultaneously
<?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 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
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.0.5, 5.1.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.3.11, 4.4.0 - 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

preferences:
99.51 ms | 410 KiB | 5 Q