3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 20000; $a = array(); for ($i = 0; $i < $count; $i++) { if ($i % 2) { $a['key_' . $i] = 'ok'; } } $time = microtime(true); $result = 0; for ($i = 0; $i < $count; $i++) { if (isset($a['key_' . $i])) { ++$result; } } $time = microtime(true) - $time; echo number_format($time, 3) . ' seconds and returned ' . $result . "\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)
7.4.10.0060.01916.22
7.4.00.0120.01216.13
7.3.130.0140.01116.04
7.3.120.0050.02016.09
7.3.110.0080.01616.04
7.3.100.0060.01016.14
7.3.90.0070.01516.03
7.3.80.0050.01316.11
7.3.70.0090.00816.02
7.3.60.0080.01316.08
7.3.50.0080.01115.83
7.3.40.0100.01015.82
7.3.30.0070.01016.04
7.3.20.0050.01616.68
7.3.10.0050.01316.57
7.3.00.0080.01216.70
7.2.260.0100.01016.17
7.2.250.0100.01616.22
7.2.240.0070.01516.02
7.2.230.0070.01616.01
7.2.220.0080.01316.07
7.2.210.0020.01815.91
7.2.200.0050.01215.99
7.2.190.0050.01216.08
7.2.180.0070.01515.94
7.2.170.0050.01815.82
7.2.160.0040.01415.70
7.2.150.0060.01616.88
7.2.140.0200.00316.88
7.2.130.0110.01416.91
7.2.120.0060.01317.03
7.2.110.0050.01317.01
7.2.100.0080.01016.94
7.2.90.0030.01317.04
7.2.80.0060.01316.82
7.2.70.0070.01217.05
7.2.60.0090.01016.94
7.2.50.0020.01616.85
7.2.40.0030.02016.71
7.2.30.0070.01716.94
7.2.20.0050.01616.96
7.2.10.0080.00917.01
7.2.00.0020.01717.64
7.1.330.0080.01115.86
7.1.320.0080.01115.79
7.1.310.0130.00815.88
7.1.300.0050.01515.72
7.1.290.0030.01515.59
7.1.280.0040.01715.91
7.1.270.0030.01715.87
7.1.260.0000.01815.84
7.1.250.0050.02015.72
7.1.240.0000.02215.97
7.1.230.0000.02015.77
7.1.220.0060.01315.82
7.1.210.0000.02015.62
7.1.200.0060.01215.98
7.1.190.0090.00915.84
7.1.180.0060.01815.57
7.1.170.0040.01515.81
7.1.160.0000.01815.75
7.1.150.0100.01715.62
7.1.140.0060.00915.77
7.1.130.0030.01616.00
7.1.120.0060.01515.84
7.1.110.0030.02115.79
7.1.100.0030.01815.89
7.1.90.0060.01515.79
7.1.80.0090.01615.46
7.1.70.0050.01316.42
7.1.60.0120.01217.71
7.1.50.0080.01716.39
7.1.40.0000.01615.61
7.1.30.0030.01615.82
7.1.20.0070.00715.95
7.1.10.0030.01315.74
7.1.00.0020.04819.06
7.0.330.0000.01615.40
7.0.320.0100.01015.50
7.0.310.0030.01715.59
7.0.300.0060.01215.35
7.0.290.0030.01715.26
7.0.280.0030.01715.55
7.0.270.0040.01815.41
7.0.260.0070.02015.31
7.0.250.0030.02415.49
7.0.240.0040.01515.22
7.0.230.0070.01015.59
7.0.220.0070.01315.50
7.0.210.0030.01515.44
7.0.200.0050.01316.20
7.0.190.0030.01515.49
7.0.180.0030.01315.58
7.0.170.0100.01015.58
7.0.160.0000.01515.57
7.0.150.0040.01115.55
7.0.140.0020.04318.76
7.0.130.0030.01615.57
7.0.120.0100.01015.48
7.0.110.0070.00715.25
7.0.100.0000.02115.35
7.0.90.0070.01015.49
7.0.80.0030.01315.50
7.0.70.0060.01215.32
7.0.60.0140.04718.18
7.0.50.0050.05117.19
7.0.40.0050.03316.81
7.0.30.0280.04416.85
7.0.20.0180.04616.65
7.0.10.0150.04616.85
7.0.00.0100.04816.66
5.6.400.0040.02816.09
5.6.390.0030.02016.19
5.6.380.0100.01616.27
5.6.370.0040.01815.97
5.6.360.0090.01615.97
5.6.350.0070.02715.92
5.6.340.0030.01915.70
5.6.330.0030.02416.17
5.6.320.0070.01715.83
5.6.310.0110.01115.92
5.6.300.0040.02115.79
5.6.290.0070.01716.24
5.6.280.0120.05519.30
5.6.270.0030.01615.96
5.6.260.0100.01716.06
5.6.250.0000.02515.71
5.6.240.0040.02215.82
5.6.230.0040.02115.93
5.6.220.0060.01916.00
5.6.210.0130.03818.92
5.6.200.0070.03117.70
5.6.190.0030.05718.73
5.6.180.0180.05218.99
5.6.170.0200.02718.99
5.6.160.0100.03918.73
5.6.150.0090.05217.77
5.6.140.0020.03617.76
5.6.130.0080.04517.78
5.6.120.0080.05719.21
5.6.110.0070.03419.36
5.6.100.0070.05519.18
5.6.90.0090.04919.25
5.6.80.0080.04518.90
5.6.70.0130.05618.95
5.6.60.0000.02615.83
5.6.50.0000.02515.86
5.6.40.0070.01715.89
5.6.30.0150.00915.86
5.6.20.0060.02316.04
5.6.10.0070.01715.94
5.6.00.0060.01915.89
5.5.380.0030.01916.12
5.5.370.0030.01915.91
5.5.360.0070.02016.16
5.5.350.0150.05318.86
5.5.340.0050.05917.61
5.5.330.0070.05118.66
5.5.320.0100.03218.68
5.5.310.0180.05018.71
5.5.300.0070.04817.53
5.5.290.0050.03717.52
5.5.280.0050.05819.18
5.5.270.0050.05119.16
5.5.260.0070.05819.31
5.5.250.0020.03518.99
5.5.240.0030.05618.54
5.5.230.0030.02115.90
5.5.220.0070.02015.88
5.5.210.0120.01815.86
5.5.200.0030.02015.77
5.5.190.0060.01915.75
5.5.180.0070.01715.70
5.5.170.0100.01615.93
5.5.160.0100.02015.48
5.5.150.0100.02015.51
5.5.140.0030.02315.80
5.5.130.0100.02015.84
5.5.120.0030.02315.57
5.5.110.0070.01715.48
5.5.100.0100.01615.83
5.5.90.0040.02215.79
5.5.80.0060.02515.70
5.5.70.0060.01615.96
5.5.60.0070.02015.26
5.5.50.0030.02115.78
5.5.40.0070.01715.77
5.5.30.0070.02115.68
5.5.20.0030.02015.42
5.5.10.0030.02315.78
5.5.00.0120.01515.48
5.4.450.0530.04016.83
5.4.440.0450.04316.75
5.4.430.0470.04016.80
5.4.420.0400.01016.76
5.4.410.0020.04716.46
5.4.400.0220.04016.43
5.4.390.0200.05016.32
5.4.380.0200.04816.40
5.4.370.0080.04716.38
5.4.360.0070.04916.36
5.4.350.0070.03013.04
5.4.340.0050.03313.04
5.4.330.0060.01912.56
5.4.320.0060.03713.28
5.4.310.0060.03113.27
5.4.300.0060.03613.28
5.4.290.0070.03413.28
5.4.280.0070.03213.22
5.4.270.0080.02813.22
5.4.260.0060.03313.22
5.4.250.0050.03913.22
5.4.240.0040.03813.22
5.4.230.0080.03313.22
5.4.220.0050.03113.22
5.4.210.0050.03413.22
5.4.200.0070.03413.22
5.4.190.0040.03913.22
5.4.180.0050.03113.22
5.4.170.0070.03413.22
5.4.160.0070.03213.22
5.4.150.0060.03413.22
5.4.140.0050.02913.06
5.4.130.0070.03013.05
5.4.120.0050.03713.03
5.4.110.0040.03613.03
5.4.100.0070.03113.03
5.4.90.0080.03313.03
5.4.80.0050.03713.03
5.4.70.0110.03313.03
5.4.60.0050.03613.03
5.4.50.0050.03813.05
5.4.40.0070.03013.03
5.4.30.0060.02913.03
5.4.20.0070.03313.02
5.4.10.0050.03313.02
5.4.00.0040.03812.77
5.3.290.0110.03013.53
5.3.280.0050.03513.49
5.3.270.0070.03513.50
5.3.260.0070.03513.50
5.3.250.0070.03413.50
5.3.240.0080.03513.50
5.3.230.0060.03813.50
5.3.220.0050.03713.48
5.3.210.0090.03613.48
5.3.200.0080.03613.48
5.3.190.0070.03713.48
5.3.180.0070.03313.48
5.3.170.0030.03713.48
5.3.160.0050.03513.48
5.3.150.0050.03713.48
5.3.140.0080.03613.48
5.3.130.0090.03813.47
5.3.120.0070.03813.47
5.3.110.0090.03413.47
5.3.100.0100.03313.22
5.3.90.0070.03813.21
5.3.80.0090.03213.20
5.3.70.0090.03413.20
5.3.60.0080.03313.20
5.3.50.0070.03513.17
5.3.40.0100.03413.17
5.3.30.0100.03613.15
5.3.20.0110.03113.04
5.3.10.0070.03913.02
5.3.00.0140.03113.01
5.2.170.0080.03610.94
5.2.160.0050.04510.94
5.2.150.0070.04910.94
5.2.140.0080.03810.93
5.2.130.0030.03910.89
5.2.120.0070.03610.89
5.2.110.0080.03510.90
5.2.100.0040.03810.97
5.2.90.0070.03610.90
5.2.80.0050.03810.88
5.2.70.0060.03710.88
5.2.60.0060.03710.84
5.2.50.0040.04010.81
5.2.40.0050.03710.79
5.2.30.0050.04010.75
5.2.20.0110.03310.75
5.2.10.0010.04010.66
5.2.00.0070.03910.52
5.1.60.0030.03710.33
5.1.50.0070.03310.32
5.1.40.0060.03310.30
5.1.30.0030.03710.66
5.1.20.0080.03310.68
5.1.10.0030.03810.41
5.1.00.0030.04310.41
5.0.50.0030.0448.89
5.0.40.0040.0378.75
5.0.30.0050.0508.56
5.0.20.0070.0378.54
5.0.10.0050.0418.51
5.0.00.0050.0498.50
4.4.90.0060.0316.93
4.4.80.0020.0366.91
4.4.70.0050.0316.90
4.4.60.0040.0356.91
4.4.50.0020.0376.92
4.4.40.0070.0466.91
4.4.30.0010.0376.91
4.4.20.0010.0396.97
4.4.10.0050.0436.98
4.4.00.0040.0506.95
4.3.110.0030.0346.85
4.3.100.0020.0376.84
4.3.90.0030.0376.83
4.3.80.0050.0486.82
4.3.70.0040.0326.82
4.3.60.0030.0346.83
4.3.50.0040.0356.82
4.3.40.0030.0436.78
4.3.30.0030.0355.59
4.3.20.0020.0355.55
4.3.10.0020.0345.52
4.3.00.0030.0477.75

preferences:
39.66 ms | 401 KiB | 5 Q