3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Test data $lead = array('date_created' => '2014-05-05 12:30:30'); date_default_timezone_set('Europe/London'); // The source timezone $sourceTimezone = new DateTimeZone('UTC'); // The target timezone $targetTimezone = new DateTimeZone(date_default_timezone_get()); // Craft the DateTime from a string and pass the target timezone in $date = DateTime::createFromFormat('Y-m-d H:i:s', $lead['date_created'], $sourceTimezone); // Add two hours to the DateTime object, fixing the timezone $date->add(new DateInterval('PT2H')); // Set the timezone to "our" timezone $date->setTimezone($targetTimezone); var_dump($date); var_dump($date->format('Y-m-d H:i'));

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.3.60.0120.00618.43
8.3.50.0170.00222.06
8.3.40.0120.00318.80
8.3.30.0140.00019.04
8.3.20.0000.00720.41
8.3.10.0040.00423.59
8.3.00.0000.00819.38
8.2.180.0120.00318.41
8.2.170.0040.01122.96
8.2.160.0030.01020.38
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00021.99
8.2.110.0100.00020.89
8.2.100.0110.00017.78
8.2.90.0000.00918.28
8.2.80.0050.00317.97
8.2.70.0060.00318.04
8.2.60.0000.00717.97
8.2.50.0050.00318.10
8.2.40.0090.00017.74
8.2.30.0080.00019.79
8.2.20.0000.00918.03
8.2.10.0000.00718.11
8.2.00.0040.00417.97
8.1.280.0100.01025.92
8.1.270.0030.00623.84
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.00421.42
8.1.230.0080.00420.98
8.1.220.0050.00317.80
8.1.210.0030.00618.90
8.1.200.0030.00617.35
8.1.190.0050.00317.35
8.1.180.0060.00318.10
8.1.170.0030.00518.73
8.1.160.0040.00421.91
8.1.150.0060.00318.64
8.1.140.0030.00617.55
8.1.130.0000.00717.83
8.1.120.0040.00417.59
8.1.110.0000.00717.54
8.1.100.0000.00717.45
8.1.90.0000.00717.44
8.1.80.0000.00817.55
8.1.70.0030.00317.51
8.1.60.0030.00617.50
8.1.50.0000.00817.52
8.1.40.0020.00517.53
8.1.30.0080.00017.67
8.1.20.0070.00017.69
8.1.10.0040.00417.60
8.1.00.0050.00317.54
8.0.300.0040.00419.98
8.0.290.0060.00316.75
8.0.280.0000.00718.44
8.0.270.0070.00016.89
8.0.260.0040.00418.35
8.0.250.0030.00317.16
8.0.240.0030.00317.07
8.0.230.0030.00317.16
8.0.220.0000.00817.05
8.0.210.0000.00717.08
8.0.200.0000.00717.06
8.0.190.0060.00317.11
8.0.180.0000.00717.10
8.0.170.0000.01017.07
8.0.160.0030.00317.03
8.0.150.0030.00816.95
8.0.140.0050.00317.04
8.0.130.0000.00613.47
8.0.120.0040.00416.88
8.0.110.0040.00417.02
8.0.100.0020.00516.84
8.0.90.0040.00416.84
8.0.80.0100.00717.05
8.0.70.0040.00417.05
8.0.60.0080.00016.88
8.0.50.0040.00416.93
8.0.30.0140.00717.24
8.0.20.0100.00917.40
8.0.10.0000.00817.19
8.0.00.0070.01716.95
7.4.330.0050.00015.15
7.4.320.0050.00316.55
7.4.300.0060.00016.59
7.4.290.0070.00016.58
7.4.280.0050.00516.57
7.4.270.0070.00016.55
7.4.260.0000.00716.48
7.4.250.0030.00516.52
7.4.240.0000.00716.53
7.4.230.0000.00716.52
7.4.220.0110.00816.52
7.4.210.0070.00716.63
7.4.200.0080.00016.44
7.4.190.0070.00016.44
7.4.160.0080.00816.61
7.4.150.0140.00317.40
7.4.140.0250.01717.86
7.4.130.0090.00916.65
7.4.120.0090.00916.68
7.4.110.0070.01016.31
7.4.100.0060.01616.46
7.4.90.0130.00416.43
7.4.80.0100.01019.39
7.4.70.0170.00016.55
7.4.60.0060.01016.70
7.4.50.0030.00516.68
7.4.40.0180.00616.51
7.4.30.0080.00816.45
7.4.00.0070.01115.25
7.3.330.0060.00013.25
7.3.320.0050.00013.16
7.3.310.0000.00716.46
7.3.300.0030.00316.38
7.3.290.0040.01116.46
7.3.280.0080.01016.41
7.3.270.0140.00517.40
7.3.260.0180.00016.38
7.3.250.0080.01016.45
7.3.240.0060.01516.41
7.3.230.0110.00716.51
7.3.210.0120.00616.44
7.3.200.0150.01019.39
7.3.190.0150.00816.29
7.3.180.0100.01016.35
7.3.170.0060.01316.46
7.3.160.0080.00816.59
7.3.120.0080.01015.01
7.3.110.0000.01714.61
7.3.100.0120.00615.01
7.3.90.0060.01214.88
7.3.80.0030.01314.90
7.3.70.0060.00614.67
7.3.60.0070.01114.93
7.3.50.0050.00514.97
7.3.40.0000.00914.92
7.3.30.0070.00715.14
7.3.20.0060.00316.50
7.3.10.0050.00716.53
7.3.00.0030.00816.69
7.2.330.0110.00816.57
7.2.320.0080.01016.38
7.2.310.0100.01016.84
7.2.300.0150.00316.45
7.2.290.0110.00716.40
7.2.250.0100.01015.29
7.2.240.0000.01815.03
7.2.230.0000.01814.68
7.2.220.0080.00815.30
7.2.210.0030.01315.10
7.2.200.0000.01215.15
7.2.190.0070.01014.67
7.2.180.0040.00814.90
7.2.170.0080.00815.11
7.2.130.0040.01116.99
7.2.120.0000.00916.57
7.2.110.0090.00616.83
7.2.100.0090.00616.78
7.2.90.0040.01117.00
7.2.80.0060.00617.02
7.2.70.0030.00717.09
7.2.60.0080.00616.79
7.2.50.0050.00517.09
7.2.40.0030.01317.10
7.2.30.0030.01016.89
7.2.20.0040.00716.90
7.2.10.0080.00417.02
7.2.00.0030.01218.21
7.1.330.0060.00915.75
7.1.320.0130.00016.11
7.1.310.0060.00915.72
7.1.300.0040.01216.02
7.1.290.0000.01016.02
7.1.280.0000.00916.03
7.1.270.0070.00715.86
7.1.260.0040.00815.91
7.1.250.0030.00515.98
7.1.200.0090.00315.46
7.1.100.0080.00418.28
7.1.70.0040.00717.00
7.1.60.0040.01819.46
7.1.50.0080.01217.18
7.1.00.0070.07322.41
7.0.200.0070.00017.07
7.0.140.0070.07022.07
7.0.60.0100.08319.91
7.0.50.0070.08017.82
7.0.40.0030.08720.30
7.0.30.0230.05320.34
7.0.20.0300.04320.21
7.0.10.0070.08320.04
7.0.00.0030.06020.30
5.6.280.0100.07021.13
5.6.210.0130.07320.76
5.6.200.0030.06718.22
5.6.190.0130.08020.48
5.6.180.0500.06320.61
5.6.170.0170.08720.50
5.6.160.0100.08020.38
5.6.150.0030.05718.08
5.6.140.0070.04018.14
5.6.130.0070.06318.22
5.6.120.0030.05321.12
5.6.110.0130.06021.11
5.6.100.0070.07021.13
5.6.90.0070.05020.97
5.6.80.0070.06020.35
5.5.350.4130.03320.42
5.5.340.0000.05717.89
5.5.330.0030.04320.22
5.5.320.0270.05020.30
5.5.310.0370.04020.29
5.5.300.0070.07317.96
5.5.290.0000.04318.01
5.5.280.0070.06020.76
5.5.270.0100.03720.79
5.5.260.0070.08020.88
5.5.250.0070.04320.58
5.5.240.0000.08020.25
5.4.450.0370.04719.42
5.4.440.0400.04719.41
5.4.430.0500.06319.57
5.4.420.0400.05719.37
5.4.410.0570.04019.45
5.4.400.0430.04318.90
5.4.390.0400.04018.79
5.4.380.0430.03718.82
5.4.370.0400.04019.09
5.4.360.0470.03319.13
5.4.350.0430.06319.25
5.4.340.0570.06319.18
5.4.320.0530.07018.95
5.4.310.0530.06319.25
5.4.300.0430.04719.22
5.4.290.0530.06319.07
5.4.280.0600.06318.93
5.4.270.0400.04719.21
5.4.260.0570.05319.08
5.4.250.0470.05019.08
5.4.240.0530.03719.13
5.4.230.0400.04019.04
5.4.220.0500.07319.05
5.4.210.0430.04718.80
5.4.200.0630.05719.08
5.4.190.0400.05718.77
5.4.180.0470.06319.15
5.4.170.0470.04019.09
5.4.160.0500.02719.07
5.4.150.0500.06019.20
5.4.140.0570.06316.50
5.4.130.0500.05716.50
5.4.120.0570.06016.59
5.4.110.0470.06716.26
5.4.100.0470.04016.44
5.4.90.0570.06016.46
5.4.80.0570.06016.42
5.4.70.0700.04716.23
5.4.60.0470.04316.36
5.4.50.0500.05316.45
5.4.40.0470.03316.32
5.4.30.0600.04716.41
5.4.20.0370.03716.43
5.4.10.0470.03316.27
5.4.00.0470.06715.61
5.3.290.0570.05314.57
5.3.280.0470.05714.48
5.3.270.0570.03014.47
5.3.260.0430.03714.55
5.3.250.0600.06014.42
5.3.240.0470.05014.64
5.3.230.0630.07014.63
5.3.220.0630.06014.52
5.3.210.0530.06714.47
5.3.200.0330.04714.40
5.3.190.0400.04314.41
5.3.180.0400.04014.42
5.3.170.0530.06014.48
5.3.160.0530.07014.66
5.3.150.0570.06314.42
5.3.140.0470.04314.43
5.3.130.0500.03314.57
5.3.120.0430.04714.59
5.3.110.0530.05714.50
5.3.100.0570.06314.01
5.3.90.0430.06313.88
5.3.80.0470.06313.85
5.3.70.0470.07013.81
5.3.60.0500.06013.95
5.3.50.0470.03714.04
5.3.40.0400.04314.00
5.3.30.0370.04013.75
5.3.20.0600.05313.72
5.3.10.0400.04013.59
5.3.00.0430.04313.42
5.2.170.0400.02710.99
5.2.160.0400.04310.98
5.2.150.0330.03310.99
5.2.140.0300.03011.15
5.2.130.0430.05310.94
5.2.120.0470.04311.15
5.2.110.0330.03010.94
5.2.100.0370.04011.12
5.2.90.0330.02711.11
5.2.80.0400.04311.10
5.2.70.0370.03010.94
5.2.60.0470.05311.10
5.2.50.0470.03010.87
5.2.40.0400.05010.83
5.2.30.0400.03311.14
5.2.20.0400.04011.00
5.2.10.0370.04710.95
5.2.00.0370.03310.76
5.1.60.0500.0139.93
5.1.50.0330.0509.86
5.1.40.0330.0279.95
5.1.30.0300.03310.39
5.1.20.0330.03310.36
5.1.10.0330.05010.00
5.1.00.0400.03310.14
5.0.50.0200.0439.66
5.0.40.0200.0439.66
5.0.30.0130.0409.66
5.0.20.0130.0309.66
5.0.10.0170.0339.66
5.0.00.0270.0339.66
4.4.90.0200.0279.66
4.4.80.0230.0209.66
4.4.70.0130.0179.66
4.4.60.0170.0339.66
4.4.50.0170.0379.66
4.4.40.0200.0479.66
4.4.30.0230.0279.66
4.4.20.0200.0309.66
4.4.10.0130.0379.66
4.4.00.0230.0479.66
4.3.110.0230.0279.66
4.3.100.0200.0309.66
4.3.90.0230.0309.66
4.3.80.0200.0379.66
4.3.70.0200.0279.66
4.3.60.0200.0179.66
4.3.50.0200.0339.66
4.3.40.0200.0509.66
4.3.30.0100.0339.66
4.3.20.0130.0339.66
4.3.10.0130.0179.66
4.3.00.0100.0339.66

preferences:
44.01 ms | 401 KiB | 5 Q