3v4l.org

run code in 300+ PHP versions simultaneously
<?php // https://gist.github.com/dave1010/11393640 class Bar{} $bars = [new Bar, new Bar, new Bar]; $ints = [1, 2, 3]; // without variadics // lots of manual type checking function oldFoo($bars) { foreach ($bars as $bar) { if (!$bar instanceof Bar) { throw new InvalidArgumentException("Must be a Bar."); } } echo "Got " . count($bars) . " bars.\n"; } // php 5.6 style // just look at this lovely type checking! function foo(Bar ...$bars) { echo "Got " . count($bars) . " bars.\n"; } foo(...$bars); // fatal error foo(...$ints); oldFoo($bars); // InvalidArgumentException oldFoo($ints);

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.0150.00018.55
8.3.50.0240.01022.12
8.3.40.0140.00718.92
8.3.30.0070.00719.14
8.3.20.0040.00420.14
8.3.10.0090.00023.65
8.3.00.0040.00420.57
8.2.180.0120.00616.88
8.2.170.0070.00722.96
8.2.160.0070.00718.91
8.2.150.0040.01124.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00321.05
8.2.110.0060.00322.23
8.2.100.0090.00317.72
8.2.90.0050.00319.36
8.2.80.0000.00817.97
8.2.70.0000.00817.75
8.2.60.0000.00918.04
8.2.50.0090.00318.07
8.2.40.0000.00818.03
8.2.30.0000.00818.15
8.2.20.0050.00217.71
8.2.10.0040.00419.50
8.2.00.0040.00417.92
8.1.280.0140.00725.92
8.1.270.0080.00023.79
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0100.00023.97
8.1.230.0080.00319.15
8.1.220.0030.00617.74
8.1.210.0060.00318.77
8.1.200.0070.00317.35
8.1.190.0080.00017.65
8.1.180.0030.00518.10
8.1.170.0000.00818.53
8.1.160.0070.00021.93
8.1.150.0000.00718.55
8.1.140.0000.00917.38
8.1.130.0070.00017.89
8.1.120.0030.00417.49
8.1.110.0040.00417.41
8.1.100.0070.00417.37
8.1.90.0020.00517.46
8.1.80.0030.00517.37
8.1.70.0040.00417.38
8.1.60.0030.00517.49
8.1.50.0050.00317.54
8.1.40.0040.00417.43
8.1.30.0080.00017.70
8.1.20.0040.00417.59
8.1.10.0000.00817.55
8.1.00.0080.00017.54
8.0.300.0090.00018.77
8.0.290.0000.00717.05
8.0.280.0040.00418.40
8.0.270.0000.00717.25
8.0.260.0080.00016.88
8.0.250.0000.00717.07
8.0.240.0040.00416.98
8.0.230.0040.00417.02
8.0.220.0070.00016.95
8.0.210.0030.00316.98
8.0.200.0030.00316.93
8.0.190.0040.00416.99
8.0.180.0040.00416.91
8.0.170.0030.00616.88
8.0.160.0000.00716.84
8.0.150.0030.00516.86
8.0.140.0040.00416.94
8.0.130.0000.00613.48
8.0.120.0040.00416.96
8.0.110.0080.00016.85
8.0.100.0040.00416.84
8.0.90.0000.00716.86
8.0.80.0000.01516.89
8.0.70.0050.00316.96
8.0.60.0040.00416.84
8.0.50.0040.00416.86
8.0.30.0090.00917.04
8.0.20.0170.00217.40
8.0.10.0000.00716.88
8.0.00.0110.00716.85
7.4.330.0050.00015.00
7.4.320.0060.00016.53
7.4.300.0040.00416.48
7.4.290.0070.00016.57
7.4.280.0030.00316.50
7.4.270.0070.00016.52
7.4.260.0000.01016.54
7.4.250.0040.00416.48
7.4.240.0000.00716.50
7.4.230.0000.00716.71
7.4.220.0120.00616.59
7.4.210.0080.00716.58
7.4.200.0000.00716.64
7.4.190.0080.00016.67
7.4.160.0110.00516.34
7.4.150.0130.00417.40
7.4.140.0090.00917.86
7.4.130.0040.01316.52
7.4.120.0120.00616.53
7.4.110.0100.01016.70
7.4.100.0140.00316.59
7.4.90.0080.01316.69
7.4.80.0060.01016.67
7.4.70.0060.01116.51
7.4.60.0100.00716.30
7.4.50.0060.00316.55
7.4.40.0060.01222.77
7.4.30.0080.00816.26
7.4.00.0040.00714.96
7.3.330.0000.00713.44
7.3.320.0050.00013.36
7.3.310.0040.00216.25
7.3.300.0030.00316.41
7.3.290.0130.00716.30
7.3.280.0100.00816.38
7.3.270.0070.01017.40
7.3.260.0140.00416.46
7.3.250.0110.00616.41
7.3.240.0130.00716.59
7.3.230.0090.00816.48
7.3.210.0080.01116.53
7.3.200.0040.01519.39
7.3.190.0100.01316.64
7.3.180.0090.00616.54
7.3.170.0130.00616.47
7.3.160.0040.01216.43
7.3.120.0030.01314.93
7.2.330.0090.01516.83
7.2.320.0100.01316.37
7.2.310.0190.00416.43
7.2.300.0000.02016.77
7.2.290.0100.00716.82
7.2.60.0250.01116.89
7.1.200.0030.00715.52
7.1.100.0050.00517.83
7.1.70.0040.00717.25
7.1.60.0000.01017.26
7.1.50.0070.00316.96
7.1.40.0030.00816.59
7.1.30.0040.00716.53
7.1.20.0070.01016.66
7.1.10.0030.00716.42
7.1.00.0040.00716.57
7.0.200.0000.00716.69
7.0.190.0060.00916.77
7.0.180.0080.00016.30
7.0.170.0000.00716.09
7.0.160.0050.00216.20
7.0.150.0080.00316.16
7.0.140.0000.01416.29
7.0.130.0000.01216.62
7.0.120.0000.00916.39
7.0.110.0040.00416.20
7.0.100.0030.01316.19
7.0.90.0000.00916.54
7.0.80.0030.01016.15
7.0.70.0040.00416.54
7.0.60.0000.00716.14
7.0.50.0060.00616.25
7.0.40.0000.00915.21
7.0.30.0040.00415.21
7.0.20.0040.01215.21
7.0.10.0000.02115.21
7.0.00.0050.00315.21
5.6.300.0060.03820.68
5.6.290.0070.05120.74
5.6.280.0030.06520.72
5.6.270.0070.03920.86
5.6.260.0030.05920.82
5.6.250.0000.09220.72
5.6.240.0030.05020.93
5.6.230.0030.09021.01
5.6.220.0040.04920.92
5.6.210.0130.08920.75
5.6.200.0030.04320.99
5.6.190.0100.07720.78
5.6.180.0040.04620.79
5.6.170.0030.05120.89
5.6.160.0070.04220.99
5.6.150.0030.08020.79
5.6.140.0040.04220.88
5.6.130.0070.04720.66
5.6.120.0100.07720.98
5.6.110.0100.08020.68
5.6.100.0070.04720.77
5.6.90.0030.06520.78
5.6.80.0030.07920.27
5.6.70.0070.06620.14
5.6.60.0190.02620.15
5.6.50.0130.05420.07
5.6.40.0060.06420.25
5.6.30.0130.07820.05
5.6.20.0090.04020.15
5.6.10.0190.02820.23
5.6.00.0030.04020.15
5.5.380.0000.09117.69
5.5.370.0070.04117.54
5.5.360.0000.05117.61
5.5.350.0100.08317.49
5.5.340.0030.06318.04
5.5.330.0100.08418.13
5.5.320.0130.03318.04
5.5.310.0130.05217.77
5.5.300.0170.03818.13
5.5.290.0000.05317.77
5.5.280.0030.04717.77
5.5.270.0030.04217.85
5.5.260.0030.05218.13
5.5.250.0200.03617.82
5.5.240.0070.06817.39
5.5.230.0030.05717.48
5.5.220.0100.07117.39
5.5.210.0100.03717.48
5.5.200.0000.04417.48
5.5.190.0070.03917.14
5.5.180.0030.05417.48
5.5.160.0170.03017.35
5.5.150.0100.07717.36
5.5.140.0000.06617.48
5.5.130.0130.08417.39
5.5.120.0000.04917.36
5.5.110.0030.05217.52
5.5.100.0030.04017.02
5.5.90.0100.04117.29
5.5.80.0000.04317.37
5.5.70.0170.03016.99
5.5.60.0100.03317.01
5.5.50.0030.04417.34
5.5.40.0100.07817.33
5.5.30.0000.05417.08
5.5.20.0100.04617.10
5.5.10.0100.03717.32
5.5.00.0000.04817.28
5.4.450.0100.07519.30
5.4.440.0060.03919.50
5.4.430.0110.03519.23
5.4.420.0070.04019.27
5.4.410.0100.07319.36
5.4.400.0000.07919.09
5.4.390.0100.03818.99
5.4.380.0200.04319.08
5.4.370.0030.03919.07
5.4.360.0070.06419.17
5.4.350.0160.05519.25
5.4.340.0030.04119.08
5.4.320.0000.04419.23
5.4.310.0130.04419.08
5.4.300.0060.04119.09
5.4.290.0070.04719.06
5.4.280.0100.04819.09
5.4.270.0100.03618.89
5.4.260.0070.04018.98
5.4.250.0000.04319.11
5.4.240.0040.03919.06
5.4.230.0030.04219.07
5.4.220.0030.04419.03
5.4.210.0070.06119.06
5.4.200.0030.09119.20
5.4.190.0030.04219.06
5.4.180.0040.03919.20
5.4.170.0070.05818.99
5.4.160.0070.04119.13
5.4.150.0000.04519.19
5.4.140.0030.04616.50
5.4.130.0100.03316.76
5.4.120.0030.03716.51
5.4.110.0030.04216.77
5.4.100.0130.03616.54
5.4.90.0070.03616.64
5.4.80.0000.04016.70
5.4.70.0070.03516.67
5.4.60.0000.04716.57
5.4.50.0060.03516.38
5.4.40.0070.03916.80
5.4.30.0160.04316.75
5.4.20.0030.04616.57
5.4.10.0160.02816.61
5.4.00.0040.03616.02
5.3.290.0070.07915.21
5.3.280.0060.03815.21
5.3.270.0100.03615.21
5.3.260.0030.04215.21
5.3.250.0000.04315.21
5.3.240.0070.04015.21
5.3.230.0030.03915.21
5.3.220.0130.03215.21
5.3.210.0030.04915.21
5.3.200.0000.04015.21
5.3.190.0030.04415.21
5.3.180.0130.03515.21
5.3.170.0030.04115.21
5.3.160.0030.04915.21
5.3.150.0130.02915.21
5.3.140.0000.04215.21
5.3.130.0030.04615.21
5.3.120.0100.04215.21
5.3.110.0070.03615.21
5.3.100.0130.03315.21
5.3.90.0070.03715.21
5.3.80.0070.03915.21
5.3.70.0070.03915.21
5.3.60.0130.03915.21
5.3.50.0230.03615.21
5.3.40.0070.03615.21
5.3.30.0030.04115.21
5.3.20.0000.04215.21
5.3.10.0030.03915.21
5.3.00.0060.03815.21

preferences:
35.74 ms | 401 KiB | 5 Q