3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = microtime(true); for ($i = 0; $i < 10000; $i++) { $array = []; $str = '|' . implode('|', array_keys($_SERVER)); do { if (false !== $pos = strpos($str, '|SCRIPT_')) { if (false !== $pos2 = strpos($str, '|', $pos + 1)) { $len = $pos2 - $pos - 1; } else { $len = null; } $array[] = substr($str, $pos + 1, $len); $str = $pos2 !== false ? substr($str, $pos2) : ''; } } while ($pos !== false && $str); } var_dump($_SERVER, count($_SERVER), $array, microtime(true) - $time);

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.60.0030.03116.39
7.4.50.0090.03416.46
7.4.40.0140.02216.14
7.4.30.0090.03516.12
7.4.20.0170.02116.41
7.4.10.0070.02916.36
7.4.00.0060.02916.35
7.3.180.0060.02616.59
7.3.170.0090.02416.46
7.3.160.0060.02916.23
7.3.150.0160.02916.28
7.3.140.0120.02416.33
7.3.130.0110.02416.41
7.3.120.0050.03316.35
7.3.110.0100.02616.36
7.3.100.0110.02416.62
7.3.90.0050.03216.26
7.3.80.0060.03216.49
7.3.70.0060.02916.44
7.3.60.0080.02416.31
7.3.50.0070.02516.37
7.3.40.0040.03016.41
7.3.30.0030.03316.29
7.3.20.0070.02817.27
7.3.10.0070.02616.91
7.3.00.0060.02816.88
7.2.310.0120.02316.57
7.2.300.0130.02116.55
7.2.290.0090.02816.73
7.2.280.0130.02716.76
7.2.270.0130.02316.61
7.2.260.0080.03916.64
7.2.250.0090.04016.63
7.2.240.0110.03116.49
7.2.230.0080.02816.62
7.2.220.0060.02916.71
7.2.210.0090.04016.54
7.2.200.0060.03016.45
7.2.190.0150.02316.61
7.2.180.0090.03716.42
7.2.170.0090.02716.47
7.2.160.0090.02816.45
7.2.150.0060.02717.40
7.2.140.0190.03417.52
7.2.130.0080.03317.15
7.2.120.0090.02517.25
7.2.110.0070.03217.20
7.2.100.0090.03217.12
7.2.90.0060.03117.18
7.2.80.0050.02917.07
7.2.70.0080.02817.19
7.2.60.0110.02517.24
7.2.50.0040.03817.22
7.2.40.0050.03117.36
7.2.30.0090.03117.13
7.2.20.0100.03417.23
7.2.10.0090.02917.17
7.2.00.0090.02617.78
7.1.330.0120.02816.52
7.1.320.0100.02816.34
7.1.310.0090.03216.44
7.1.300.0100.03116.38
7.1.290.0050.03616.43
7.1.280.0110.03116.32
7.1.270.0050.03316.28
7.1.260.0060.03816.33
7.1.250.0060.03216.13
7.1.240.0070.03616.22
7.1.230.0100.03416.06
7.1.220.0050.03215.95
7.1.210.0030.03416.10
7.1.200.0070.02916.12
7.1.190.0050.03816.14
7.1.180.0090.03016.08
7.1.170.0100.03616.22
7.1.160.0040.03616.02
7.1.150.0120.03416.13
7.1.140.0100.03516.17
7.1.130.0100.03316.15
7.1.120.0070.03216.30
7.1.110.0070.03916.12
7.1.100.0080.03816.01
7.1.90.0120.03616.07
7.1.80.0070.03616.11
7.1.70.0090.03216.27
7.1.60.0140.03217.01
7.1.50.0050.03916.35
7.1.40.0130.03416.12
7.1.30.0080.03116.13
7.1.20.0100.03016.08
7.1.10.0070.03916.12
7.1.00.0060.05117.83
7.0.330.0070.03015.81
7.0.320.0040.03415.79
7.0.310.0080.03015.85
7.0.300.0190.03015.60
7.0.290.0090.03215.80
7.0.280.0090.03615.81
7.0.270.0110.03015.77
7.0.260.0090.03415.75
7.0.250.0060.03515.88
7.0.240.0050.03615.90
7.0.230.0110.03515.87
7.0.220.0090.03315.90
7.0.210.0100.03415.81
7.0.200.0150.03315.55
7.0.190.0110.02815.91
7.0.180.0040.03415.91
7.0.170.0080.03615.77
7.0.160.0070.03115.91
7.0.150.0120.03015.82
7.0.140.0040.04917.28
7.0.130.0070.03315.86
7.0.120.0060.03715.82
7.0.110.0080.04116.78
7.0.100.0070.03316.78
7.0.90.0060.03916.76
7.0.80.0080.03516.75
7.0.70.0080.03616.84
7.0.60.0090.03816.78
7.0.50.0070.04916.86
7.0.40.0080.04115.85
7.0.30.0060.04315.83
7.0.20.0080.03815.71
7.0.10.0070.04915.83
7.0.00.0070.04415.68
5.6.400.0060.06915.87
5.6.390.0040.07515.89
5.6.380.0130.06115.45
5.6.370.0050.07615.03
5.6.360.0060.06715.23
5.6.350.0080.07515.31
5.6.340.0120.08115.23
5.6.330.0090.08015.16
5.6.320.0090.06515.42
5.6.310.0080.07315.65
5.6.300.0040.06915.61
5.6.290.0040.07415.45
5.6.280.0070.07515.49
5.6.270.0120.07115.23
5.6.260.0080.07016.45
5.6.250.0030.07416.52
5.6.240.0050.06616.54
5.6.230.0060.06616.62
5.6.220.0070.06516.46
5.6.210.0080.06316.67
5.6.200.0060.06416.83
5.6.190.0070.07916.81
5.6.180.0030.08616.77
5.6.170.0070.08516.68
5.6.160.0110.07716.73
5.6.150.0070.09316.60
5.6.140.0040.08216.62
5.6.130.0070.07716.64
5.6.120.0060.09016.56
5.6.110.0050.07216.59
5.6.100.0040.08416.73
5.6.90.0090.07916.54
5.6.80.0070.08016.41
5.6.70.0080.07816.32
5.6.60.0060.08016.45
5.6.50.0090.08016.35
5.6.40.0060.08116.40
5.6.30.0070.07216.41
5.6.20.0080.07716.60
5.6.10.0080.08116.36
5.6.00.0070.08416.45
5.5.380.0050.07215.11
5.5.370.0070.07315.03
5.5.360.0050.07615.03
5.5.350.0030.07515.12
5.5.340.0080.08015.17
5.5.330.0100.08315.27
5.5.320.0020.07815.17
5.5.310.0080.08515.27
5.5.300.0090.07615.28
5.5.290.0080.07815.19
5.5.280.0070.07515.03
5.5.270.0060.08615.28
5.5.260.0050.08515.23
5.5.250.0110.08115.24
5.5.240.0100.08515.06
5.5.230.0130.09114.92
5.5.220.0030.07914.93
5.5.210.0070.08515.03
5.5.200.0090.08214.98
5.5.190.0120.07614.89
5.5.180.0070.08715.01
5.5.170.0090.06414.22
5.5.160.0060.07015.02
5.5.150.0030.06915.04
5.5.140.0060.08115.06
5.5.130.0050.07515.01
5.5.120.0070.07614.93
5.5.110.0050.07214.89
5.5.100.0050.07214.90
5.5.90.0070.06815.03
5.5.80.0060.07314.98
5.5.70.0060.08014.94
5.5.60.0120.06715.01
5.5.50.0080.07614.84
5.5.40.0120.08115.02
5.5.30.0070.08214.92
5.5.20.0140.08214.93
5.5.10.0090.08514.79
5.5.00.0040.08414.79
5.4.450.0060.06814.00
5.4.440.0060.09013.91
5.4.430.0080.09013.93
5.4.420.0100.07813.94
5.4.410.0080.07813.96
5.4.400.0030.08613.83
5.4.390.0060.07613.78
5.4.380.0050.09213.89
5.4.370.0070.07413.80
5.4.360.0080.07913.82
5.4.350.0050.07913.62
5.4.340.0060.09113.84
5.4.330.0060.06812.05
5.4.320.0060.06913.80
5.4.310.0070.07413.84
5.4.300.0070.07813.72
5.4.290.0050.06713.68
5.4.280.0060.06313.80
5.4.270.0020.08113.69
5.4.260.0060.06513.71
5.4.250.0050.07413.74
5.4.240.0020.07813.67
5.4.230.0050.07213.72
5.4.220.0050.07313.70
5.4.210.0070.07513.73
5.4.200.0100.07213.77
5.4.190.0060.08213.69
5.4.180.0110.08813.67
5.4.170.0040.08113.68
5.4.160.0080.07613.79
5.4.150.0040.08813.63
5.4.140.0060.07913.11
5.4.130.0020.07713.10
5.4.120.0060.06913.20
5.4.110.0070.08713.13
5.4.100.0020.09013.12
5.4.90.0050.07113.04
5.4.80.0060.07613.14
5.4.70.0050.08913.01
5.4.60.0080.07813.02
5.4.50.0080.07613.09
5.4.40.0060.08213.07
5.4.30.0050.08413.13
5.4.20.0040.07613.08
5.4.10.0050.07013.06
5.4.00.0050.07112.88
5.3.290.0080.01612.54
5.3.280.0040.02912.46
5.3.270.0010.03312.45
5.3.260.0090.02412.47
5.3.250.0070.02612.48
5.3.240.0010.01912.39
5.3.230.0040.02912.41
5.3.220.0050.03112.48
5.3.210.0120.02512.46
5.3.200.0030.01912.41
5.3.190.0030.02812.49
5.3.180.0060.01812.46
5.3.170.0100.02812.47
5.3.160.0110.02212.50
5.3.150.0010.02912.59
5.3.140.0040.02112.51
5.3.130.0020.03212.52
5.3.120.0050.01712.52
5.3.110.0020.02912.45
5.3.100.0040.02212.42
5.3.90.0070.01512.33
5.3.80.0070.01612.29
5.3.70.0020.02012.27
5.3.60.0050.01412.23
5.3.50.0040.01912.28
5.3.40.0070.01512.21
5.3.30.0050.02012.14
5.3.20.0030.01712.07
5.3.10.0070.01711.98
5.3.00.0070.02711.93
5.2.170.0050.01211.05
5.2.160.0050.01311.06
5.2.150.0060.01211.07
5.2.140.0060.01211.05
5.2.130.0050.01911.06
5.2.120.0040.01311.02
5.2.110.0030.02511.01
5.2.100.0040.01611.01
5.2.90.0050.01111.02
5.2.80.0050.02611.04
5.2.70.0090.02011.00
5.2.60.0040.02111.02
5.2.50.0030.02311.03
5.2.40.0060.01911.04
5.2.30.0070.01310.99
5.2.20.0020.02310.95
5.2.10.0050.01310.94
5.2.00.0000.01910.99
5.1.60.0070.01010.80
5.1.50.0040.01210.71
5.1.40.0020.01410.72
5.1.30.0050.01110.77
5.1.20.0020.01210.73
5.1.10.0040.01110.82
5.1.00.0040.01910.70
5.0.50.0030.01410.51
5.0.40.0030.00810.51
5.0.30.0040.01510.51
5.0.20.0040.01110.51
5.0.10.0020.01010.51
5.0.00.0040.01410.51
4.4.90.0030.01410.51
4.4.80.0020.01310.51
4.4.70.0030.00710.51
4.4.60.0020.00910.51
4.4.50.0020.00910.51
4.4.40.0020.01210.51
4.4.30.0020.00710.51
4.4.20.0010.01010.51
4.4.10.0000.00810.51
4.4.00.0020.01110.51
4.3.110.0040.00710.51
4.3.100.0010.01210.51
4.3.90.0040.00510.51
4.3.80.0010.02110.51
4.3.70.0010.00910.51
4.3.60.0030.01510.51
4.3.50.0030.00910.51
4.3.40.0030.02010.51
4.3.30.0010.01410.51
4.3.20.0010.01110.51
4.3.10.0030.01110.51
4.3.00.0010.01310.51

preferences:
37.84 ms | 401 KiB | 5 Q