3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = '2015-01-01T00:00:00.000Z'; echo "================================================================\n Trying to set a DateTimeZone using a date with a timezone\n DATE: {$date}\n\n"; echo "DateTimeZone will be ignored because date has a timezone 'Z'\n"; $dateTime = new DateTime($date, new DateTimeZone('America/Mexico_City')); echo $dateTime->format('c'). "\n\n"; echo "DateTimeZone will be ignored, date timezone is in UTC anyway!\n"; $dateTime = new DateTime($date, new DateTimeZone('UTC')); echo $dateTime->format('c'). "\n\n"; $date = '2015-01-01T00:00:00.000'; echo "================================================================\n Trying to set a DateTimeZone using a date with NO timezone\n DATE: {$date}\n\n"; echo "Timezone will be set to the given DateTimeZone America/Mexico_City\n"; $dateTime = new DateTime($date, new DateTimeZone('America/Mexico_City')); echo $dateTime->format('c'). "\n\n"; echo "Timezone will be set to the given DateTimeZone UTC\n"; $dateTime = new DateTime($date, new DateTimeZone('UTC')); echo $dateTime->format('c'). "\n\n"; $date = '2015-01-01T00:00:00.000 America/Mexico_City'; echo "================================================================\n Trying to set a timezone directly in the date\n DATE: {$date}\n\n"; echo "Timezone will set to the given timezone set in the date string America/Mexico_City\n"; $dateTime = new DateTime($date); echo $dateTime->format('c'). "\n\n"; $date = '2015-01-01T00:00:00.000'; echo "================================================================\n DateTimeZone: setting it in construct vs setTimezone method\n DATE: {$date}\n\n"; echo "Set timezone using construct:\n"; $dateTime = new DateTime($date, new DateTimeZone('America/Mexico_City')); echo $dateTime->format('c'). "\n\n"; echo "Set timezone using method (notice the hour changes here in addition to the timezone):\n"; $dateTime = new DateTime($date); $dateTime->setTimezone(new DateTimeZone('America/Mexico_City')); echo $dateTime->format('c'). "\n";

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.00.0110.01020.37
8.4.150.0020.00014.05
8.4.140.0160.00618.25
8.4.130.0100.01018.50
8.4.120.0110.01021.06
8.4.110.0110.00622.58
8.4.100.0100.00818.20
8.4.90.0130.00919.11
8.4.80.0060.00418.41
8.4.70.0120.00918.34
8.4.60.0100.01119.41
8.4.50.0140.00721.00
8.4.40.0070.01319.88
8.4.30.0040.00418.30
8.4.20.0160.00318.39
8.4.10.0030.00618.25
8.3.280.0110.00920.65
8.3.270.0090.01017.10
8.3.260.0040.00516.93
8.3.250.0100.00819.09
8.3.240.0120.00717.12
8.3.230.0130.00616.79
8.3.220.0050.00317.43
8.3.210.0090.00719.15
8.3.200.0060.00517.00
8.3.190.0030.00517.60
8.3.180.0110.00817.16
8.3.170.0070.01117.52
8.3.160.0060.01321.04
8.3.150.0070.00317.00
8.3.140.0070.00317.36
8.3.130.0060.00318.96
8.3.120.0040.00419.29
8.3.110.0040.00420.94
8.3.100.0060.00324.06
8.3.90.0150.00626.77
8.3.80.0040.00417.38
8.3.70.0130.00317.13
8.3.60.0090.00617.00
8.3.50.0090.01123.10
8.3.40.0040.01219.47
8.3.30.0090.00619.32
8.3.20.0040.00420.58
8.3.10.0050.00323.90
8.3.00.0080.00017.75
8.2.290.0100.00920.88
8.2.280.0080.00418.94
8.2.270.0100.01017.95
8.2.260.0150.00018.79
8.2.250.0070.00318.95
8.2.240.0000.01117.57
8.2.230.0030.00522.58
8.2.220.0070.00737.54
8.2.210.0000.00826.77
8.2.200.0070.00417.25
8.2.190.0040.01218.56
8.2.180.0120.00817.13
8.2.170.0070.00722.96
8.2.160.0080.00620.78
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00321.31
8.2.110.0090.00022.38
8.2.100.0090.00318.41
8.2.90.0080.00018.13
8.2.80.0070.00319.07
8.2.70.0040.00418.00
8.2.60.0030.00518.25
8.2.50.0060.00318.00
8.2.40.0030.00620.13
8.2.30.0050.00218.33
8.2.20.0000.00818.39
8.2.10.0050.00218.44
8.2.00.0030.00518.25
8.1.330.0120.00722.16
8.1.320.0050.00416.79
8.1.310.0000.00818.76
8.1.300.0000.00920.30
8.1.290.0060.00330.84
8.1.280.0170.00325.92
8.1.270.0030.00624.16
8.1.260.0090.00026.35
8.1.250.0050.00228.09
8.1.240.0140.00324.27
8.1.230.0040.00822.91
8.1.220.0090.00019.00
8.1.210.0030.00618.77
8.1.200.0030.00517.73
8.1.190.0040.00417.73
8.1.180.0000.00818.10
8.1.170.0000.00919.09
8.1.160.0050.00222.16
8.1.150.0000.00819.27
8.1.140.0040.00417.89
8.1.130.0070.00018.27
8.1.120.0050.00318.09
8.1.110.0000.00818.00
8.1.100.0040.00418.03
8.1.90.0040.00418.02
8.1.80.0070.00017.97
8.1.70.0070.00018.01
8.1.60.0040.00418.11
8.1.50.0060.00317.89
8.1.40.0040.00417.90
8.1.30.0030.00618.12
8.1.20.0080.00018.10
8.1.10.0040.00417.98
8.1.00.0040.00418.06
8.0.300.0080.00018.77
8.0.290.0050.00217.38
8.0.280.0000.00718.86
8.0.270.0030.00317.51
8.0.260.0000.00717.69
8.0.250.0000.00817.57
8.0.240.0000.00917.51
8.0.230.0040.00417.55
8.0.220.0000.00717.39
8.0.210.0040.00417.43
8.0.200.0030.00317.57
8.0.190.0030.00617.52
8.0.180.0000.00717.44
8.0.170.0050.00317.49
8.0.160.0050.00317.35
8.0.150.0080.00017.40
8.0.140.0000.00717.44
8.0.130.0000.00613.86
8.0.120.0080.00017.43
8.0.110.0000.00717.44
8.0.100.0030.00517.36
8.0.90.0070.00017.41
8.0.80.0120.00817.28
8.0.70.0000.00817.29
8.0.60.0070.00017.59
8.0.50.0030.00517.51
8.0.30.0120.01417.46
8.0.20.0110.00817.44
8.0.10.0000.00717.35
8.0.00.0080.01017.18
7.4.330.0060.00015.37
7.4.320.0000.00717.10
7.4.300.0070.00016.89
7.4.290.0000.00716.98
7.4.280.0000.01117.08
7.4.270.0040.00416.97
7.4.260.0000.00717.04
7.4.250.0000.00816.99
7.4.240.0020.00617.05
7.4.230.0030.00316.92
7.4.220.0140.00416.98
7.4.210.0060.01016.94
7.4.200.0040.00416.85
7.4.160.0080.00816.81
7.4.150.0090.00917.40
7.4.140.0040.01617.86
7.4.130.0110.00716.88
7.4.120.0110.00716.86
7.4.110.0120.00616.82
7.4.100.0080.01016.82
7.4.90.0030.01416.84
7.4.80.0060.01919.39
7.4.70.0180.00916.73
7.4.60.0180.00616.99
7.4.50.0030.00516.80
7.4.40.0140.00916.71
7.4.30.0070.01016.76
7.4.00.0060.00915.54
7.3.330.0080.00013.64
7.3.320.0000.00513.55
7.3.310.0000.00816.88
7.3.300.0040.00416.87
7.3.290.0040.01116.64
7.3.280.0140.00416.66
7.3.270.0070.01017.40
7.3.260.0130.00416.59
7.3.250.0100.01016.86
7.3.240.0060.01517.03
7.3.230.0050.01316.84
7.3.210.0080.01216.89
7.3.200.0120.01119.39
7.3.190.0030.01316.95
7.3.180.0060.01016.79
7.3.170.0040.01716.96
7.3.160.0080.00816.73
7.2.330.0090.00817.21
7.2.320.0120.01216.95
7.2.310.0070.01017.16
7.2.300.0060.01317.08
7.2.290.0080.01116.99
7.2.60.0100.00717.18
7.2.00.0030.00919.56
7.1.200.0030.01015.75
7.1.100.0000.01218.22
7.1.70.0000.00817.34
7.1.60.0040.01919.40
7.1.50.0000.01516.88
7.1.00.0130.06722.30
7.0.200.0080.00315.38
7.0.140.0030.07322.18
7.0.60.0070.07721.71
7.0.50.0030.08022.06
7.0.40.0030.08720.08
7.0.30.0100.08320.07
7.0.20.0030.07320.18
7.0.10.0030.08720.07
7.0.00.0100.04320.11
5.6.280.0000.07721.10
5.6.210.0100.07720.64
5.6.200.0100.07320.98
5.6.190.0030.08021.11
5.6.180.0100.08021.02
5.6.170.0030.08321.01
5.6.160.0030.08021.10
5.6.150.0030.08321.04
5.6.140.0030.05721.01
5.6.130.0030.09021.06
5.6.120.0030.04020.98
5.6.110.0000.04321.00
5.6.100.0000.04321.01
5.6.90.0030.05721.05
5.6.80.0030.03720.45
5.6.70.0000.04020.51
5.6.60.0070.04020.43
5.6.50.0030.03020.38
5.6.40.0030.04720.47
5.6.30.0000.04320.52
5.6.20.0030.03020.51
5.6.10.0030.03320.42
5.6.00.0000.03720.37
5.5.350.0070.06720.34
5.5.340.0030.08020.63
5.5.330.0100.07320.87
5.5.320.0070.08320.87
5.5.310.0000.06320.86
5.5.300.0030.06020.89
5.5.290.0030.09020.91
5.5.280.0000.05720.81
5.5.270.0000.04320.86
5.5.260.0030.06020.86
5.5.250.0030.06020.56
5.5.240.0070.03320.27
5.5.230.0030.03020.16
5.5.220.0000.05020.25
5.5.210.0000.03320.19
5.5.200.0000.04320.33
5.5.190.0030.03020.17
5.5.180.0000.03320.04
5.5.160.0000.03320.02
5.5.150.0070.02720.34
5.5.140.0100.02320.25
5.5.130.0030.03020.02
5.5.120.0030.03020.13
5.5.110.0000.03320.32
5.5.100.0000.03320.03
5.5.90.0000.03320.14
5.5.80.0030.03319.91
5.5.70.0000.03320.03
5.5.60.0000.04020.11
5.5.50.0000.03020.12
5.5.40.0000.03320.01
5.5.30.0000.03320.11
5.5.20.0030.05320.13
5.5.10.0000.06319.93
5.5.00.0030.07320.05
5.4.450.0030.07019.33
5.4.440.0000.05019.18
5.4.430.0000.04019.42
5.4.420.0000.04019.32
5.4.410.0030.03719.12
5.4.400.0000.04019.06
5.4.390.0030.04018.87
5.4.380.0000.03718.97
5.4.370.0000.04318.85
5.4.360.0000.03719.01
5.4.350.0000.05018.95
5.4.340.0000.04318.86
5.4.320.0070.03719.01
5.4.310.0030.03018.99
5.4.300.0000.03719.05
5.4.290.0100.02719.00
5.4.280.0000.03319.19
5.4.270.0000.03319.01
5.4.260.0070.03018.89
5.4.250.0000.03019.19
5.4.240.0030.02719.06
5.4.230.0030.03019.16
5.4.220.0030.02718.85
5.4.210.0000.03318.98
5.4.200.0000.04018.94
5.4.190.0000.03018.89
5.4.180.0000.05318.84
5.4.170.0070.07319.15
5.4.160.0000.08018.98
5.4.150.0130.07019.04
5.4.140.0030.07316.44
5.4.130.0070.06716.41
5.4.120.0030.07316.32
5.4.110.0030.07716.53
5.4.100.0130.06716.24
5.4.90.0070.05716.45
5.4.80.0070.06316.52
5.4.70.0130.06016.32
5.4.60.0070.06716.27
5.4.50.0070.06316.33
5.4.40.0070.06716.33
5.4.30.0000.07716.27
5.4.20.0070.07016.17
5.4.10.0000.07316.21
5.4.00.0000.07315.81
5.3.290.0000.04314.61
5.3.280.0070.03014.51
5.3.270.0030.06714.60
5.3.260.0000.08014.57
5.3.250.0030.07714.55
5.3.240.0000.07314.64
5.3.230.0030.06714.60
5.3.220.0030.06714.56
5.3.210.0070.06714.57
5.3.200.0030.07714.55
5.3.190.0030.08014.52
5.3.180.0030.07014.47
5.3.170.0000.07014.56
5.3.160.0030.07714.39
5.3.150.0070.07314.53
5.3.140.0030.07314.54
5.3.130.0000.07714.49
5.3.120.0000.08014.41
5.3.110.0000.07714.56
5.3.100.0030.06713.95
5.3.90.0070.05314.03
5.3.80.0000.03714.01
5.3.70.0100.07014.04
5.3.60.0100.05313.92
5.3.50.0030.07313.94
5.3.40.0070.06713.90
5.3.30.0000.07313.90
5.3.20.0000.05013.72
5.3.10.0030.06313.64
5.3.00.0000.07713.59
5.2.170.0100.05311.00
5.2.160.0000.06011.14
5.2.150.0030.06011.15
5.2.140.0030.06311.13
5.2.130.0070.03311.06
5.2.120.0000.06011.10
5.2.110.0030.04311.03
5.2.100.0170.05710.97
5.2.90.0000.05010.96
5.2.80.0030.05011.10
5.2.70.0030.06010.91
5.2.60.0000.06710.81
5.2.50.0070.05011.02
5.2.40.0030.05011.03
5.2.30.0030.05010.91
5.2.20.0070.05310.96
5.2.10.0030.06010.86
5.2.00.0000.05710.70
5.1.60.0030.04710.57
5.1.50.0070.04710.57
5.1.40.0030.05310.57
5.1.30.0070.05710.57
5.1.20.0000.05710.57
5.1.10.0000.05710.57
5.1.00.0030.03710.57
5.0.50.0000.04710.57
5.0.40.0030.04310.57
5.0.30.0100.06010.57
5.0.20.0030.04310.57
5.0.10.0070.03710.57
5.0.00.0070.06310.57
4.4.90.0070.03010.57
4.4.80.0000.03710.57
4.4.70.0000.03710.57
4.4.60.0000.03010.57
4.4.50.0030.02710.57
4.4.40.0000.05710.57
4.4.30.0030.03310.57
4.4.20.0000.03310.57
4.4.10.0000.03710.57
4.4.00.0030.05310.57
4.3.110.0000.03310.57
4.3.100.0030.03310.57
4.3.90.0030.03010.57
4.3.80.0070.04310.57
4.3.70.0030.03010.57
4.3.60.0070.03010.57
4.3.50.0000.03710.57
4.3.40.0030.05010.57
4.3.30.0000.03710.57
4.3.20.0070.03010.57
4.3.10.0030.03710.57
4.3.00.0000.03310.57

preferences:
33.74 ms | 403 KiB | 5 Q