3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $bar = mt_rand(); } $iterations = 1000000; $a = microtime(true); for ($i = 0; $i < $iterations; $i++) { $bar = mt_rand(); } $b = microtime(true); for ($i = 0; $i < $iterations; $i++) { foo(); } $c = microtime(true); $ab = $b - $a; $bc = $c - $b; $abcPercent = (($bc / $ab) - 1) * 100; printf('Direct: %s seconds' . PHP_EOL, number_format($ab, 4)); printf('Function: %s seconds (%s%% more!)', number_format($bc, 4), number_format($abcPercent, 2));

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.0240.08125.92
8.3.20.0030.08023.53
8.3.10.0140.05323.61
8.3.00.0070.08620.54
8.2.150.0100.06021.01
8.2.140.0070.08022.13
8.2.130.0170.08622.13
8.2.120.0100.06021.08
8.2.110.0100.05721.08
8.2.100.0030.06520.70
8.2.90.0070.06320.71
8.2.80.0130.07421.18
8.2.70.0100.06020.48
8.2.60.0100.07420.62
8.2.50.0100.05621.00
8.2.40.0060.06120.59
8.2.30.0070.08220.38
8.2.20.0070.07620.43
8.2.10.0070.04718.48
8.2.00.0070.05519.16
8.1.290.0190.05537.54
8.1.270.0100.06224.04
8.1.260.0100.06724.03
8.1.250.0070.06324.03
8.1.240.0160.06920.43
8.1.230.0070.06020.40
8.1.220.0130.05320.85
8.1.210.0130.05420.37
8.1.200.0160.04820.42
8.1.190.0130.07620.59
8.1.180.0170.05020.39
8.1.170.0130.05120.60
8.1.160.0070.05720.09
8.1.150.0160.07520.43
8.1.140.0070.05018.89
8.1.130.0050.06418.90
8.1.120.0150.06718.78
8.1.110.0100.06418.85
8.1.100.0090.06418.91
8.1.90.0140.05318.88
8.1.80.0050.05318.46
8.1.70.0080.05218.81
8.1.60.0160.04919.10
8.1.50.0100.05119.00
8.1.40.0080.04819.16
8.1.30.0070.05819.05
8.1.20.0130.04719.69
8.1.10.0090.05019.04
8.1.00.0120.06418.86
8.0.300.0130.06619.79
8.0.290.0230.05217.76
8.0.280.0220.05417.87
8.0.270.0070.05118.41
8.0.260.0160.05117.38
8.0.250.0230.04817.39
8.0.240.0100.05117.39
8.0.230.0130.06117.24
8.0.220.0090.05717.32
8.0.210.0150.04717.35
8.0.200.0140.06317.41
8.0.190.0130.05417.26
8.0.180.0070.05217.33
8.0.170.0070.05417.24
8.0.160.0110.04318.20
8.0.150.0150.05717.21
8.0.140.0120.06417.17
8.0.130.0130.05317.27
8.0.120.0130.05517.11
8.0.110.0070.05518.21
8.0.100.0070.05317.19
8.0.90.0170.07317.27
8.0.80.0160.04917.27
8.0.70.0100.05917.07
8.0.60.0100.06017.18
8.0.50.0120.05917.03
8.0.30.0080.06217.21
8.0.20.0080.06017.26
8.0.10.0180.06917.30
8.0.00.0110.06217.81
7.4.330.0190.06115.24
7.4.320.0220.07016.79
7.4.300.0210.05916.86
7.4.290.0160.05917.12
7.4.280.0190.05716.98
7.4.270.0130.06117.02
7.4.260.0170.06116.94
7.4.250.0120.06017.01
7.4.240.0210.05216.87
7.4.230.0190.06916.99
7.4.220.0220.05717.02
7.4.210.0230.06017.03
7.4.200.0090.07816.79
7.4.190.0130.06516.97
7.4.180.0150.06516.81
7.4.160.0180.07016.92
7.4.150.0180.06616.91
7.4.140.0130.06716.71
7.4.130.0120.06516.83
7.4.120.0140.06916.77
7.4.110.0110.06716.85
7.4.100.0150.06316.90
7.4.90.0130.07216.80
7.4.80.0120.07316.77
7.4.70.0110.06716.87
7.4.60.0150.07016.78
7.4.50.0130.09116.76
7.4.40.0150.08216.70
7.4.30.0150.06616.84
7.4.20.0130.07916.74
7.4.10.0100.07116.75
7.4.00.0170.06816.72
7.3.330.0150.06616.87
7.3.320.0170.07217.64
7.3.310.0180.06316.85
7.3.300.0170.08117.02
7.3.290.0250.06616.74
7.3.280.0150.06816.67
7.3.270.0170.06816.66
7.3.260.0110.07616.63
7.3.250.0120.07417.39
7.3.240.0110.06816.76
7.3.230.0170.06716.71
7.3.220.0160.07416.70
7.3.210.0150.07016.65
7.3.200.0090.07616.58
7.3.190.0110.07216.59
7.3.180.0130.06816.65
7.3.170.0130.09116.84
7.3.160.0130.08216.65
7.3.150.0170.07116.61
7.3.140.0160.07116.61
7.3.130.0110.08116.63
7.3.120.0150.07916.64
7.3.110.0130.07416.82
7.3.100.0150.06616.54
7.3.90.0130.08916.79
7.3.80.0120.07016.25
7.3.70.0110.07715.91
7.3.60.0120.06816.04
7.3.50.0130.08915.96
7.3.40.0080.07715.93
7.3.30.0120.07115.96
7.3.20.0170.07717.42
7.3.10.0120.07217.31
7.3.00.0120.07717.44
7.2.340.0180.08416.70
7.2.330.0170.08016.60
7.2.320.0170.08616.63
7.2.310.0210.08016.72
7.2.300.0170.08316.54
7.2.290.0140.08716.59
7.2.280.0140.09216.74
7.2.270.0170.08516.75
7.2.260.0190.07916.61
7.2.250.0170.08716.81
7.2.240.0230.08116.59
7.2.230.0150.08216.67
7.2.220.0180.07916.77
7.2.210.0180.09016.26
7.2.200.0150.08816.11
7.2.190.0160.07516.02
7.2.180.0160.08516.04
7.2.170.0150.08616.20
7.2.160.0150.08716.11
7.2.150.0140.08817.53
7.2.140.0190.09317.52
7.2.130.0130.08117.67
7.2.120.0170.08517.67
7.2.110.0150.09017.63
7.2.100.0150.08117.53
7.2.90.0170.08317.52
7.2.80.0130.07717.60
7.2.70.0140.07717.67
7.2.60.0130.08317.61
7.2.50.0130.08617.68
7.2.40.0220.08617.63
7.2.30.0130.09517.66
7.2.20.0150.09217.68
7.2.10.0170.08517.67
7.2.00.0120.09417.95
7.1.330.0220.10417.05
7.1.320.0170.10417.16
7.1.310.0160.10116.76
7.1.300.0120.09416.54
7.1.290.0140.08816.52
7.1.280.0170.11416.60
7.1.270.0150.11416.78
7.1.260.0130.08816.48
7.1.250.0130.10216.50
7.1.240.0160.09616.53
7.1.230.0160.09016.55
7.1.220.0110.10416.52
7.1.210.0210.08616.44
7.1.200.0130.08716.56
7.1.190.0180.08916.57
7.1.180.0150.09716.50
7.1.170.0130.08916.58
7.1.160.0170.08816.48
7.1.150.0120.11216.53
7.1.140.0140.11216.56
7.1.130.0150.09616.58
7.1.120.0200.10216.57
7.1.110.0170.10016.44
7.1.100.0160.10716.50
7.1.90.0160.11516.33
7.1.80.0160.09816.43
7.1.70.0150.09316.40
7.1.60.0140.09118.99
7.1.50.0220.11519.00
7.1.40.0210.10119.18
7.1.30.0180.10819.30
7.1.20.0190.10019.17
7.1.10.0340.09716.20
7.1.00.0130.10117.08
7.0.330.0160.09316.16
7.0.320.0200.09316.16
7.0.310.0170.09816.14
7.0.300.0160.09716.22
7.0.290.0170.09016.19
7.0.280.0180.10916.19
7.0.270.0160.10116.23
7.0.260.0160.10616.21
7.0.250.0160.10316.21
7.0.240.0130.09916.27
7.0.230.0210.10616.22
7.0.220.0150.09616.15
7.0.210.0160.10516.08
7.0.200.0150.10916.12
7.0.190.0170.11016.05
7.0.180.0140.11015.96
7.0.170.0340.11516.01
7.0.160.0180.10915.94
7.0.150.0140.10415.95
7.0.140.0150.11816.85
7.0.130.0140.12416.95
7.0.120.0130.11616.83
7.0.110.0130.10716.94
7.0.100.0140.12516.83
7.0.90.0120.10816.79
7.0.80.0120.10216.75
7.0.70.0130.10616.83
7.0.60.0120.11116.85
7.0.50.0140.12316.81
7.0.40.0160.10616.90
7.0.30.0100.11616.87
7.0.20.0190.13216.88
7.0.10.0100.11116.82
7.0.00.0130.12216.82
5.6.400.0130.21615.51
5.6.390.0170.20015.42
5.6.380.0190.20515.59
5.6.370.0130.22415.52
5.6.360.0170.20615.48
5.6.350.0130.22315.44
5.6.340.0120.20015.59
5.6.330.0110.20615.45
5.6.320.0140.21315.45
5.6.310.0130.20615.57
5.6.300.0190.21316.18
5.6.290.0140.23117.10
5.6.280.0200.22516.99
5.6.270.0140.23317.10
5.6.260.0150.22917.07
5.6.250.0150.23816.97
5.6.240.0150.22417.06
5.6.230.0160.22717.09
5.6.220.0120.23117.12
5.6.210.0210.22917.05
5.6.200.0120.22817.10
5.6.190.0170.22617.13
5.6.180.0130.22717.13
5.6.170.0180.22117.04
5.6.160.0120.24417.11
5.6.150.0110.23417.07
5.6.140.0140.24117.15
5.6.130.0120.22917.11
5.6.120.0140.23317.12
5.6.110.0140.25617.08
5.6.100.0130.23317.00
5.6.90.0170.22917.04
5.6.80.0150.22016.79
5.6.70.0140.22716.85
5.6.60.0170.22116.80
5.6.50.0230.23416.80
5.6.40.0140.24716.81
5.6.30.0130.23216.84
5.6.20.0160.22416.82
5.6.10.0160.22916.81
5.6.00.0160.21916.85
5.5.380.0230.25316.87
5.5.370.0260.24116.76
5.5.360.0300.23416.78
5.5.350.0200.22916.89
5.5.340.0230.24316.66
5.5.330.0330.23116.95
5.5.320.0140.23416.83
5.5.310.0200.22316.91
5.5.300.0170.25716.55
5.5.290.0300.24316.72
5.5.280.0140.23616.80
5.5.270.0360.22616.85
5.5.260.0200.23616.71
5.5.250.0170.25616.91
5.5.240.0170.21817.04
5.5.230.0200.22316.86
5.5.220.0270.24516.99
5.5.210.0200.24916.80
5.5.200.0230.25016.49
5.5.190.0230.22116.70
5.5.180.0270.23616.40
5.5.170.0260.22416.66
5.5.160.0230.23716.84
5.5.150.0100.22016.54
5.5.140.0230.24816.67
5.5.130.0170.24516.43
5.5.120.0290.23616.54
5.5.110.0200.24816.67
5.5.100.0200.23916.89
5.5.90.0230.24016.79
5.5.80.0160.24317.01
5.5.70.0170.23317.02
5.5.60.0260.22416.85
5.5.50.0170.23116.61
5.5.40.0300.24616.73
5.5.30.0200.24317.00
5.5.20.0230.25016.72
5.5.10.0200.22416.81
5.5.00.0230.24916.96
5.4.450.0100.25314.18
5.4.440.0200.22014.18
5.4.430.0130.24714.18
5.4.420.0200.24114.18
5.4.410.0200.22714.18
5.4.400.0200.22514.18
5.4.390.0170.24414.18
5.4.380.0230.24514.18
5.4.370.0130.23414.18
5.4.360.0170.23214.18
5.4.350.0200.25014.18
5.4.340.0200.24414.18
5.4.330.0230.24414.18
5.4.320.0200.24814.18
5.4.310.0130.23514.18
5.4.300.0130.24214.18
5.4.290.0170.24214.18
5.4.280.0100.23114.18
5.4.270.0230.30314.18
5.4.260.0230.23714.18
5.4.250.0170.24214.18
5.4.240.0170.22614.18
5.4.230.0200.23914.18
5.4.220.0200.24014.18
5.4.210.0170.22814.18
5.4.200.0140.23114.18
5.4.190.0200.22614.18
5.4.180.0200.24714.18
5.4.170.0140.23414.18
5.4.160.0100.24914.18
5.4.150.0200.22114.18
5.4.140.0100.22514.18
5.4.130.0200.24414.18
5.4.120.0070.23914.18
5.4.110.0170.24314.18
5.4.100.0230.22314.18
5.4.90.0100.23614.18
5.4.80.0260.24514.18
5.4.70.0100.24814.18
5.4.60.0140.23114.18
5.4.50.0130.23414.18
5.4.40.0230.22114.18
5.4.30.0130.23114.18
5.4.20.0200.22714.18
5.4.10.0200.24114.18
5.4.00.0170.22514.18
5.3.290.0130.27914.18
5.3.280.0160.26714.18
5.3.270.0230.27814.18
5.3.260.0130.27314.18
5.3.250.0200.28114.18
5.3.240.0100.27814.18
5.3.230.0170.27914.18
5.3.220.0100.27014.18
5.3.210.0170.28414.18
5.3.200.0130.26714.18
5.3.190.0140.28614.18
5.3.180.0140.28814.18
5.3.170.0130.27214.18
5.3.160.0130.27114.18
5.3.150.0100.27514.18
5.3.140.0170.27214.18
5.3.130.0200.26914.18
5.3.120.0130.29714.18
5.3.110.0230.26314.18
5.3.100.0200.26214.18
5.3.90.0200.27414.18
5.3.80.0140.27014.18
5.3.70.0100.29214.18
5.3.60.0170.26914.18
5.3.50.0070.27514.18
5.3.40.0170.26314.18
5.3.30.0100.28914.18
5.3.20.0200.28714.18
5.3.10.0130.27114.18
5.3.00.0170.27014.18
5.2.170.0170.35314.18
5.2.160.0230.37514.18
5.2.150.0200.36014.18
5.2.140.0130.36614.18
5.2.130.0070.36114.18
5.2.120.0070.35314.18
5.2.110.0100.35014.18
5.2.100.0130.37914.18
5.2.90.0070.36614.18
5.2.80.0200.36314.18
5.2.70.0100.35314.18
5.2.60.0070.37814.18
5.2.50.0130.35114.18
5.2.40.0100.35814.18
5.2.30.0130.39114.18
5.2.20.0200.35714.18
5.2.10.0100.35514.18
5.2.00.0100.38314.18
5.1.60.0170.35414.18
5.1.50.0070.37614.18
5.1.40.0100.35714.18
5.1.30.0100.37214.18
5.1.20.0170.35614.18
5.1.10.0170.35214.18
5.1.00.0130.36314.18
5.0.50.0130.68414.18
5.0.40.0100.65714.18
5.0.30.0130.66714.18
5.0.20.0000.63714.18
5.0.10.0070.64614.18
5.0.00.0100.64714.18
4.4.90.0130.55914.18
4.4.80.0030.58014.18
4.4.70.0130.65514.18
4.4.60.0100.73714.18
4.4.50.0000.57614.18
4.4.40.0070.57914.18
4.4.30.0100.56214.18
4.4.20.0100.57314.18
4.4.10.0070.65114.18
4.4.00.0000.58914.18
4.3.110.0070.61814.18
4.3.100.0070.57114.18
4.3.90.0000.59014.18
4.3.80.0100.57514.18
4.3.70.0070.55714.18
4.3.60.0200.59014.18
4.3.50.0070.57714.18
4.3.40.0070.53314.18
4.3.30.0070.56414.18
4.3.20.0071.99914.18
4.3.10.0071.99614.18
4.3.00.0071.99214.18

preferences:
30.88 ms | 403 KiB | 5 Q