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; print '--- Vancouver => UTC ---' . PHP_EOL; $string1 = $date1->format('Y-m-d\TH:i:s'); $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.0120.00316.88
8.3.50.0070.01318.43
8.3.40.0000.01518.74
8.3.30.0190.00018.97
8.3.20.0000.00819.10
8.3.10.0040.00421.79
8.3.00.0070.00020.71
8.2.180.0100.01418.79
8.2.170.0120.00322.96
8.2.160.0140.00020.39
8.2.150.0030.00524.18
8.2.140.0070.00024.66
8.2.130.0030.00620.07
8.2.120.0070.00026.35
8.2.110.0040.00419.39
8.2.100.0110.00017.91
8.2.90.0030.00517.75
8.2.80.0060.00318.86
8.2.70.0000.00817.88
8.2.60.0040.00417.75
8.2.50.0000.00917.88
8.2.40.0050.00320.65
8.2.30.0020.00519.50
8.2.20.0050.00218.26
8.2.10.0000.00718.14
8.2.00.0040.00418.07
8.1.280.0070.00725.92
8.1.270.0030.00620.59
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0100.00023.82
8.1.230.0040.00820.89
8.1.220.0080.00018.83
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0040.00417.48
8.1.180.0040.00418.10
8.1.170.0030.00518.72
8.1.160.0040.00419.11
8.1.150.0000.00720.33
8.1.140.0050.00319.71
8.1.130.0000.00717.85
8.1.120.0000.00717.72
8.1.110.0040.00417.74
8.1.100.0030.00617.63
8.1.90.0040.00417.72
8.1.80.0000.00717.67
8.1.70.0000.00817.75
8.1.60.0040.00417.85
8.1.50.0030.00517.75
8.1.40.0000.00717.76
8.1.30.0040.00417.71
8.1.20.0080.00017.81
8.1.10.0040.00417.79
8.1.00.0000.00817.78
8.0.300.0000.00719.90
8.0.290.0040.00417.00
8.0.280.0000.00718.50
8.0.270.0070.00017.42
8.0.260.0000.00717.42
8.0.250.0030.00317.20
8.0.240.0040.00417.24
8.0.230.0030.00317.21
8.0.220.0080.00017.17
8.0.210.0000.00717.16
8.0.200.0000.00717.23
8.0.190.0050.00317.16
8.0.180.0040.00417.23
8.0.170.0060.00317.24
8.0.160.0040.00417.11
8.0.150.0050.00317.10
8.0.140.0000.00817.16
8.0.130.0060.00013.50
8.0.120.0040.00417.17
8.0.110.0000.00717.23
8.0.100.0040.00417.14
8.0.90.0040.00417.06
8.0.80.0000.01517.21
8.0.70.0040.00417.02
8.0.60.0000.00717.07
8.0.50.0000.00717.20
8.0.30.0090.01017.38
8.0.20.0120.00617.40
8.0.10.0040.00417.22
8.0.00.0060.01217.07
7.4.330.0000.00515.55
7.4.320.0040.00416.77
7.4.300.0060.00016.64
7.4.290.0000.01116.75
7.4.280.0040.00416.78
7.4.270.0070.00016.52
7.4.260.0070.00316.75
7.4.250.0040.00416.62
7.4.240.0030.00316.75
7.4.230.0000.00716.62
7.4.220.0040.01416.61
7.4.210.0090.00616.82
7.4.200.0040.00416.78
7.4.160.0090.00716.72
7.4.150.0100.01017.40
7.4.140.0170.01017.86
7.4.130.0100.00716.63
7.4.120.0090.00816.69
7.4.110.0100.00716.67
7.4.100.0140.00316.66
7.4.90.0090.00916.48
7.4.80.0150.00319.39
7.4.70.0140.00316.57
7.4.60.0100.00716.79
7.4.50.0100.00616.53
7.4.40.0120.00516.85
7.4.30.0090.00916.77
7.4.00.0090.00814.99
7.3.330.0000.00513.37
7.3.320.0000.00513.32
7.3.310.0030.00316.38
7.3.300.0080.00016.41
7.3.290.0090.00416.58
7.3.280.0070.01316.59
7.3.270.0200.00417.40
7.3.260.0150.00316.62
7.3.250.0060.01116.57
7.3.240.0130.00916.76
7.3.230.0150.00916.64
7.3.210.0100.00716.75
7.3.200.0100.00816.74
7.3.190.0120.00616.60
7.3.180.0090.00916.82
7.3.170.0110.01116.88
7.3.160.0060.01216.43
7.3.120.0100.00715.06
7.3.110.0040.01515.27
7.3.100.0070.01015.13
7.3.90.0000.01414.74
7.3.80.0100.00715.02
7.3.70.0030.00714.89
7.3.60.0100.00615.05
7.3.50.0060.00915.00
7.3.40.0000.01415.15
7.3.30.0040.01114.70
7.3.20.0040.00816.73
7.3.10.0030.01016.81
7.3.00.0060.00616.92
7.2.330.0070.01016.79
7.2.320.0190.00017.04
7.2.310.0060.01217.07
7.2.300.0110.01516.80
7.2.290.0130.00416.70
7.2.250.0070.01115.19
7.2.240.0040.01514.89
7.2.230.0070.00715.28
7.2.220.0120.00314.94
7.2.210.0130.00715.26
7.2.200.0000.01115.05
7.2.190.0030.00715.05
7.2.180.0000.01315.27
7.2.170.0080.00415.38
7.2.60.0200.00816.51
7.2.50.0090.00316.94
7.1.330.0150.00015.71
7.1.320.0060.00915.92
7.1.310.0060.00915.81
7.1.300.0040.01116.02
7.1.290.0070.00416.02
7.1.280.0070.00715.88
7.1.270.0040.01115.85
7.1.260.0070.00415.59
7.1.200.0000.01115.88
7.1.70.0000.01117.25
7.1.60.0060.00617.49
7.1.00.0070.07322.41
7.0.200.0070.01116.76
7.0.130.0070.06322.25
7.0.120.0030.06322.11
7.0.110.0070.07322.00
7.0.100.0100.08721.96
7.0.90.0000.06722.20
7.0.80.0200.07322.03
7.0.70.0130.06021.98
7.0.60.0130.05021.97
7.0.50.0270.04322.13
7.0.40.0000.06321.98
7.0.30.0030.06322.14
7.0.20.0230.04021.98
7.0.10.0130.08322.02
7.0.00.0030.06022.12
5.6.280.0030.08020.83
5.6.270.0170.06020.93
5.6.260.0230.04320.90
5.6.250.0130.05320.78
5.6.240.0200.06020.79
5.6.230.0100.09021.02
5.6.220.0130.06020.76
5.6.210.0070.06021.00
5.6.200.0130.08020.79
5.6.190.0100.05721.04
5.6.180.0070.05720.89
5.6.170.0030.06021.08
5.6.160.0100.05720.88
5.6.150.0170.05721.00
5.6.140.0200.05320.97
5.6.130.0100.06020.88
5.6.120.0130.05721.04
5.6.110.0130.05320.86
5.6.100.0100.06720.86
5.6.90.0000.06321.06
5.6.80.0100.05720.27
5.6.70.0170.05020.15
5.6.60.0170.05720.26
5.6.50.0130.05020.44
5.6.40.0170.05020.13
5.6.30.0070.06020.26
5.6.20.0170.05320.20
5.6.10.0070.05320.23
5.6.00.0130.05320.33

preferences:
57.86 ms | 401 KiB | 5 Q