3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vancouver = new \DateTimeZone('America/Vancouver'); $utc = new \DateTimeZone('UTC'); $timestamp1 = 1478422920; $date1 = new \DateTime('@' . $timestamp1); print '--- UTC ---' . PHP_EOL; print $timestamp1 . PHP_EOL; print $date1->format('c') . PHP_EOL; print '--- UTC => Vancouver ---' . PHP_EOL; $date1->setTimezone($vancouver); print $date1->format('c') . PHP_EOL; print $date1->format('Y-m-d\TH:i:s') . PHP_EOL; $string1 = $date1->format('Y-m-d\TH:i:s'); print '--- Vancouver => UTC ---' . PHP_EOL; $date2 = new \DateTime($string1, $vancouver); $timestamp2 = $date2->getTimestamp(); print $timestamp2 . PHP_EOL; print $date2->format('c') . PHP_EOL; $date2->setTimezone($utc); print $date2->format('c') . PHP_EOL;

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.0170.00016.88
8.3.50.0090.01222.05
8.3.40.0120.00318.96
8.3.30.0120.00318.80
8.3.20.0000.00819.32
8.3.10.0040.00421.69
8.3.00.0080.00020.75
8.2.180.0130.01018.66
8.2.170.0100.00722.96
8.2.160.0070.00720.49
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00420.14
8.2.120.0080.00026.35
8.2.110.0090.00021.18
8.2.100.0030.00917.97
8.2.90.0030.00617.97
8.2.80.0000.00818.05
8.2.70.0060.00318.16
8.2.60.0090.00018.28
8.2.50.0040.00418.10
8.2.40.0000.00820.63
8.2.30.0080.00019.40
8.2.20.0000.00718.08
8.2.10.0060.00318.37
8.2.00.0000.00717.96
8.1.280.0090.00925.92
8.1.270.0030.00622.17
8.1.260.0000.00828.09
8.1.250.0030.00528.09
8.1.240.0090.00022.54
8.1.230.0080.00420.62
8.1.220.0030.00517.78
8.1.210.0040.00418.77
8.1.200.0030.00617.60
8.1.190.0000.00817.63
8.1.180.0040.00418.10
8.1.170.0060.00318.83
8.1.160.0080.00019.04
8.1.150.0000.00720.28
8.1.140.0040.00419.79
8.1.130.0000.00817.76
8.1.120.0000.00717.75
8.1.110.0000.00817.75
8.1.100.0060.00317.64
8.1.90.0070.00217.76
8.1.80.0040.00417.75
8.1.70.0000.00717.75
8.1.60.0030.00617.85
8.1.50.0000.00817.63
8.1.40.0090.00017.73
8.1.30.0040.00417.84
8.1.20.0050.00517.76
8.1.10.0030.00717.82
8.1.00.0000.00817.64
8.0.300.0060.00321.63
8.0.290.0000.00917.00
8.0.280.0080.00018.60
8.0.270.0050.00217.32
8.0.260.0070.00017.14
8.0.250.0000.00817.13
8.0.240.0030.00317.13
8.0.230.0000.00717.21
8.0.220.0000.00817.10
8.0.210.0030.00317.14
8.0.200.0000.00617.12
8.0.190.0000.01017.20
8.0.180.0040.00417.18
8.0.170.0000.00817.19
8.0.160.0000.00817.23
8.0.150.0050.00317.07
8.0.140.0000.00717.18
8.0.130.0040.00413.57
8.0.120.0040.00417.20
8.0.110.0040.00417.20
8.0.100.0070.00017.07
8.0.90.0040.00417.04
8.0.80.0090.00917.05
8.0.70.0050.00217.17
8.0.60.0040.00417.14
8.0.50.0000.00717.03
8.0.30.0100.00817.25
8.0.20.0110.00717.42
8.0.10.0050.00317.19
8.0.00.0190.00316.79
7.4.330.0070.00015.55
7.4.320.0030.00316.73
7.4.300.0000.00716.75
7.4.290.0070.00516.58
7.4.280.0070.00416.63
7.4.270.0070.00016.56
7.4.260.0030.00916.63
7.4.250.0000.00716.74
7.4.240.0040.00416.80
7.4.230.0000.00716.50
7.4.220.0120.00616.77
7.4.210.0070.00716.78
7.4.200.0070.00016.51
7.4.160.0070.00816.88
7.4.150.0110.00717.40
7.4.140.0070.01017.86
7.4.130.0100.00716.69
7.4.120.0080.01016.62
7.4.110.0070.01616.52
7.4.100.0100.00716.73
7.4.90.0100.00716.73
7.4.80.0100.01319.39
7.4.70.0060.01116.70
7.4.60.0130.00516.54
7.4.50.0060.00916.66
7.4.40.0110.00716.80
7.4.30.0060.01016.51
7.4.00.0060.00915.23
7.3.330.0040.00413.32
7.3.320.0040.00213.29
7.3.310.0030.00316.62
7.3.300.0040.00416.39
7.3.290.0090.00416.59
7.3.280.0090.00916.58
7.3.270.0160.00617.40
7.3.260.0080.00816.59
7.3.250.0090.00816.56
7.3.240.0100.01216.82
7.3.230.0130.00716.52
7.3.210.0070.00916.68
7.3.200.0090.00916.82
7.3.190.0080.01216.76
7.3.180.0170.00016.71
7.3.170.0110.00716.66
7.3.160.0130.00616.77
7.3.10.0000.01116.68
7.3.00.0000.01216.69
7.2.330.0130.00316.68
7.2.320.0120.01417.00
7.2.310.0080.00817.05
7.2.300.0100.01016.78
7.2.290.0140.00317.02
7.2.130.0090.00617.23
7.2.120.0090.00617.17
7.2.110.0160.00317.21
7.2.100.0030.01017.23
7.2.90.0030.00917.22
7.2.80.0060.00617.30
7.2.70.0060.00317.17
7.2.60.0070.01017.14
7.2.50.0060.00917.09
7.2.40.0000.01017.07
7.2.30.0060.00617.17
7.2.20.0070.00717.15
7.2.10.0000.00916.97
7.2.00.0150.00017.31
7.1.250.0030.01015.77
7.1.200.0030.00615.80
7.1.70.0000.01017.00
7.1.60.0030.00717.50
7.1.00.0030.07722.44
7.0.200.0570.00714.92
7.0.130.0670.05020.28
7.0.120.0470.05320.47
7.0.110.0470.05020.31
7.0.100.0500.06020.33
7.0.90.0570.06320.40
7.0.80.0470.05020.22
7.0.70.0530.06020.29
7.0.60.0400.05020.26
7.0.50.0630.07320.38
7.0.40.0670.07320.34
7.0.30.0400.05720.35
7.0.20.0300.06020.34
7.0.10.0330.05720.17
7.0.00.0330.06720.36
5.6.280.0170.04720.79
5.6.270.0070.06021.02
5.6.260.0170.04721.13
5.6.250.0030.06720.93
5.6.240.0100.06320.82
5.6.230.0130.05721.13
5.6.220.0130.07021.01
5.6.210.0170.06720.98
5.6.200.0170.07720.81
5.6.190.0270.05320.90
5.6.180.0200.04721.06
5.6.170.0030.06321.05
5.6.160.0130.06021.09
5.6.150.0100.06020.92
5.6.140.0130.05720.88
5.6.130.0100.06021.06
5.6.120.0070.07020.86
5.6.110.0070.06720.86
5.6.100.0070.06321.04
5.6.90.0230.04720.85
5.6.80.0200.04320.13
5.6.70.0200.05020.18
5.6.60.0130.05320.39
5.6.50.0000.06320.27
5.6.40.0130.05020.39
5.6.30.0100.05720.25
5.6.20.0100.05320.43
5.6.10.0130.05020.41
5.6.00.0200.05320.16

preferences:
58.85 ms | 401 KiB | 5 Q