3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = uniqid(); function getNumber($val) { $lets = array(); foreach (range('a', 'z') as $let) { $lets[] = ("'`" . $let . "`is'"); } $nums = array(); foreach (range(1, 26) as $num) { $nums[] = $num; } $val = strtolower($val); die(preg_replace('`a`is', 1, 'this bullasda')); $ret = preg_replace($lets, $nums, $val); die($ret); $ret = substr($ret, 0, 10); return $ret; } $b = getNumber($a); echo "<pre>"; var_dump($b);

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.00.0060.01015.16
7.3.120.0120.00614.99
7.3.110.0120.00614.79
7.3.100.0060.01015.07
7.3.90.0030.01215.00
7.3.80.0060.01015.18
7.3.70.0090.00614.63
7.3.60.0090.00614.80
7.3.50.0040.00715.06
7.3.40.0060.00914.86
7.3.30.0030.00915.00
7.3.20.0030.00617.13
7.3.10.0140.00316.85
7.3.00.0060.00616.93
7.2.250.0040.01715.34
7.2.240.0090.00915.38
7.2.230.0100.01015.17
7.2.220.0000.01415.33
7.2.210.0130.00315.06
7.2.200.0030.01215.02
7.2.190.0030.01015.32
7.2.180.0100.00315.46
7.2.170.0070.00715.16
7.1.330.0040.01116.01
7.1.320.0000.01516.09
7.1.310.0060.00916.07
7.1.300.0100.00615.82
7.1.290.0040.00416.15
7.1.280.0070.00715.75
7.1.270.0090.00616.00
7.1.260.0110.00415.79
7.1.70.0050.00217.24
7.1.60.0060.01319.40
7.1.50.0000.01117.17
7.1.00.0030.06322.33
7.0.200.0370.00714.71
7.0.140.0100.06722.12
7.0.120.0070.06021.96
7.0.60.0000.04719.92
7.0.50.0070.08018.00
7.0.40.0100.06020.26
7.0.30.0230.04020.09
7.0.20.0200.08320.32
7.0.10.0070.08320.26
7.0.00.0100.08320.13
5.6.280.0130.06320.82
5.6.210.0130.05720.48
5.6.200.0030.04018.29
5.6.190.0100.05320.50
5.6.180.0200.04320.67
5.6.170.0230.05720.57
5.6.160.0130.08020.47
5.6.150.0030.04318.15
5.6.140.0030.07018.18
5.6.130.0030.08318.21
5.6.120.0100.06720.98
5.6.110.0100.08021.11
5.6.100.0070.08321.09
5.6.90.0000.05721.01
5.6.80.0130.07320.29
5.5.350.0370.06720.30
5.5.340.0100.06017.96
5.5.330.0030.05020.43
5.5.320.0170.04020.25
5.5.310.0270.03320.41
5.5.300.0070.07318.02
5.5.290.0130.07318.09
5.5.280.0070.04720.73
5.5.270.0070.04020.89
5.5.260.0100.08320.86
5.5.250.0200.07720.59
5.5.240.0000.08020.26
5.4.450.0030.04019.18
5.4.440.0100.03319.47
5.4.430.0030.04019.30
5.4.420.0000.05319.52
5.4.410.0070.04319.20
5.4.400.0100.05018.86
5.4.390.0030.08018.88
5.4.380.0000.08719.14
5.4.370.0130.07318.92
5.4.360.0070.03719.01
5.4.350.0130.06719.15
5.4.340.0000.04719.00
5.4.320.0030.05319.23
5.4.310.0100.03019.01
5.4.300.0170.03319.24
5.4.290.0030.05019.14
5.4.280.0030.04719.00
5.4.270.0070.03718.85
5.4.260.0100.07019.07
5.4.250.0030.05019.08
5.4.240.0170.04018.86
5.4.230.0130.06719.00
5.4.220.0100.06318.86
5.4.210.0070.05019.14
5.4.200.0130.05719.26
5.4.190.0170.05718.84
5.4.180.0100.06719.15
5.4.170.0100.04319.23
5.4.160.0070.03719.22
5.4.150.0170.05719.06
5.4.140.0070.05716.46
5.4.130.0070.06316.50
5.4.120.0070.07316.36
5.4.110.0030.07316.32
5.4.100.0030.04016.56
5.4.90.0070.07016.46
5.4.80.0070.05716.55
5.4.70.0030.04716.43
5.4.60.0100.04016.29
5.4.50.0070.08016.43
5.4.40.0100.03316.50
5.4.30.0030.04716.44
5.4.20.0030.07016.46
5.4.10.0130.03016.50
5.4.00.0030.03715.76
5.3.290.0030.04014.70
5.3.280.0070.04714.63
5.3.270.0070.07714.64
5.3.260.0070.08014.62
5.3.250.0070.07314.62
5.3.240.0170.06014.63
5.3.230.0100.07714.60
5.3.220.0000.07714.60
5.3.210.0030.08014.58
5.3.200.0130.04314.73
5.3.190.0030.07014.63
5.3.180.0070.03714.56
5.3.170.0100.03714.57
5.3.160.0200.05714.63
5.3.150.0170.06314.49
5.3.140.0070.04714.62
5.3.130.0070.03714.59
5.3.120.0070.03714.61
5.3.110.0030.04714.71
5.3.100.0100.06314.07
5.3.90.0030.04014.02
5.3.80.0030.03714.02
5.3.70.0030.04014.18
5.3.60.0030.03714.07
5.3.50.0000.04014.11
5.3.40.0030.07013.99
5.3.30.0000.07314.06
5.3.20.0030.04313.87
5.3.10.0100.06013.66
5.3.00.0100.04313.64
5.2.170.0000.03311.04
5.2.160.0070.02711.11
5.2.150.0030.03311.15
5.2.140.0070.06311.21
5.2.130.0130.02711.15
5.2.120.0030.06711.11
5.2.110.0070.06011.10
5.2.100.0070.04011.18
5.2.90.0000.04011.08
5.2.80.0070.05011.02
5.2.70.0170.05011.06
5.2.60.0070.06011.11
5.2.50.0000.06011.07
5.2.40.0030.05010.90
5.2.30.0070.06010.93
5.2.20.0000.03011.01
5.2.10.0130.02710.91
5.2.00.0000.03010.69
5.1.60.0030.02710.03
5.1.50.0030.04710.05
5.1.40.0030.03010.05
5.1.30.0070.05310.26
5.1.20.0030.03010.33
5.1.10.0000.03310.07
5.1.00.0030.04310.22
5.0.50.0100.0178.63
5.0.40.0000.0208.57
5.0.30.0070.0638.24
5.0.20.0000.0438.18
5.0.10.0000.0308.18
5.0.00.0100.0238.23
4.4.90.0070.0378.03
4.4.80.0000.0238.03
4.4.70.0000.0308.03
4.4.60.0100.0208.03
4.4.50.0000.0178.03
4.4.40.0030.0238.03
4.4.30.0070.0108.03
4.4.20.0000.0238.03
4.4.10.0030.0308.03
4.4.00.0000.0278.03
4.3.110.0030.0378.03
4.3.100.0030.0238.03
4.3.90.0000.0178.03
4.3.80.0070.0478.03
4.3.70.0000.0208.03
4.3.60.0000.0308.03
4.3.50.0030.0138.03
4.3.40.0030.0438.03
4.3.30.0000.0308.03
4.3.20.0030.0338.03
4.3.10.0070.0338.03
4.3.00.0030.0308.03

preferences:
33.49 ms | 401 KiB | 5 Q