3v4l.org

run code in 300+ PHP versions simultaneously
<?php $total = 10000; $paragraph = 'this is a sentence. Crud! $$$$!'; $words = explode(' ', $paragraph); $badWordHash = [ '$$$$' => true, '@#$%' => true, 'crud' => true, 'fud' => true, 'fudd' => true, 'dud' => true ]; $s = microtime(true); for ($j = 0; $j < $total; $j++) { foreach ($words as $word) { isset($badWordHash[strtolower($word)]); } } echo "isset: ", (microtime(true) - $s), PHP_EOL; $s = microtime(true); for ($j = 0; $j < $total; $j++) { foreach ($words as $word) { array_key_exists(strtolower($word), $badWordHash); } } echo "array_key_exists: ", (microtime(true) - $s), PHP_EOL;

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.0000.02915.02
7.3.120.0000.02714.84
7.3.110.0070.02314.61
7.3.100.0060.01814.54
7.3.90.0030.01515.04
7.3.80.0060.01614.96
7.3.70.0070.02014.86
7.3.60.0000.02314.63
7.3.50.0090.01514.67
7.3.40.0100.01414.80
7.3.30.0060.01614.82
7.3.20.0130.01316.64
7.3.10.0070.01616.47
7.3.00.0030.01916.64
7.2.250.0030.02414.84
7.2.240.0100.02315.16
7.2.230.0000.02814.76
7.2.220.0030.01915.11
7.2.210.0070.02014.56
7.2.200.0070.01715.09
7.2.190.0070.02015.00
7.2.180.0000.02014.61
7.2.170.0100.01614.75
7.2.00.0030.01319.13
7.1.330.0060.02915.57
7.1.320.0030.02615.75
7.1.310.0130.01915.84
7.1.300.0000.03115.77
7.1.290.0030.03015.80
7.1.280.0070.02715.61
7.1.270.0100.02015.54
7.1.260.0030.03115.80
7.1.70.0090.00617.00
7.1.60.0200.01619.82
7.1.50.0030.03417.15
7.1.00.0000.09022.25
7.0.200.0040.01816.93
7.0.140.0030.08722.06
7.0.60.0070.08319.80
7.0.50.0000.10017.92
7.0.40.0070.08320.30
7.0.30.0230.06320.33
7.0.20.0370.07020.17
7.0.10.0100.08020.20
7.0.00.0100.04320.01
5.6.280.0100.11321.07
5.6.210.0070.05720.55
5.6.200.0070.10318.16
5.6.190.0100.09020.43
5.6.180.2630.05720.76
5.6.170.0230.06320.50
5.6.160.0100.09720.49
5.6.150.0130.07018.11
5.6.140.0100.07718.17
5.6.130.0100.11018.07
5.6.120.0070.11021.00
5.6.110.0070.06021.01
5.6.100.0130.11021.13
5.6.90.0000.06320.88
5.6.80.0030.07020.37
5.6.70.4300.06720.50
5.5.350.0100.11020.34
5.5.340.0130.09717.97
5.5.330.0000.07720.57
5.5.320.0300.10320.28
5.5.310.0300.09720.26
5.5.300.0030.11717.88
5.5.290.0030.11717.95
5.5.280.0070.08020.88
5.5.270.0130.11320.88
5.5.260.0100.11020.77
5.5.250.0030.07320.59
5.5.240.0070.10320.27
5.4.450.0030.06019.39
5.4.440.0000.06019.41
5.4.430.0000.06319.40
5.4.420.0000.06319.13
5.4.410.0000.06019.07
5.4.400.0100.10318.88
5.4.390.0100.12318.92
5.4.380.0030.09718.88
5.4.370.0030.10719.06
5.4.360.0130.10319.24
5.4.350.0070.09319.13
5.4.340.0030.08718.81
5.4.320.0100.10318.80
5.4.310.0100.07019.22
5.4.300.0170.10019.13
5.4.290.0030.11318.78
5.4.280.0070.11318.80
5.4.270.0100.10719.06
5.4.260.0030.09319.07
5.4.250.0000.11019.25
5.4.240.0130.10319.08
5.4.230.0030.10019.21
5.4.220.0030.10019.24
5.4.210.0070.10719.08
5.4.200.0030.10719.09
5.4.190.0030.10719.08
5.4.180.0100.10719.09
5.4.170.0030.09018.89
5.4.160.0100.10719.09
5.4.150.0070.05719.22
5.4.140.0070.10316.45
5.4.130.0070.07016.27
5.4.120.0000.05716.22
5.4.110.0000.06016.34
5.4.100.0000.06316.25
5.4.90.0070.08716.43
5.4.80.0070.10716.41
5.4.70.0000.09316.39
5.4.60.0000.08716.32
5.4.50.0000.06716.40
5.4.40.0030.09016.18
5.4.30.0030.10316.42
5.4.20.0070.09716.18
5.4.10.0100.08316.36
5.4.00.0030.08015.76
5.3.290.0030.05714.50
5.3.280.0130.06314.64
5.3.270.0100.07014.51
5.3.260.0070.06714.47
5.3.250.0000.07714.45
5.3.240.0070.05014.59
5.3.230.0100.04014.47
5.3.220.0000.04314.42
5.3.210.0100.07014.47
5.3.200.0000.04014.52
5.3.190.0070.07014.62
5.3.180.0000.07714.51
5.3.170.0000.08314.56
5.3.160.0000.07014.46
5.3.150.0030.04714.47
5.3.140.0000.07714.58
5.3.130.0070.07714.40
5.3.120.0030.06714.50
5.3.110.0030.05314.39
5.3.100.0030.04714.13
5.3.90.0000.06013.86
5.3.80.0070.04014.11
5.3.70.0000.04714.07
5.3.60.0070.06713.86
5.3.50.0000.05713.78
5.3.40.0030.07713.82
5.3.30.0100.07313.76
5.3.20.0030.05713.60
5.3.10.0000.03713.45
5.3.00.0030.06713.49
5.2.170.0130.04712.36
5.2.160.0000.06012.36
5.2.150.0000.07012.36
5.2.140.0070.06012.36
5.2.130.0000.05012.36
5.2.120.0000.03312.36
5.2.110.0030.03312.36
5.2.100.0000.04312.36
5.2.90.0070.02312.36
5.2.80.0030.04312.36
5.2.70.0000.04012.36
5.2.60.0030.05712.36
5.2.50.0000.05712.36
5.2.40.0030.04312.36
5.2.30.0030.06012.36
5.2.20.0070.05712.36
5.2.10.0030.06012.36
5.2.00.0000.04312.36
5.1.60.0070.03712.36
5.1.50.0030.05012.36
5.1.40.0000.04712.36
5.1.30.0000.03712.36
5.1.20.0030.05312.36
5.1.10.0030.05712.36
5.1.00.0030.04312.36
5.0.50.0030.04012.36
5.0.40.0070.03712.36
5.0.30.0000.05312.36
5.0.20.0070.03312.36
5.0.10.0070.04012.36
5.0.00.0070.05012.36
4.4.90.0030.02312.36
4.4.80.0000.02312.36
4.4.70.0070.03012.36
4.4.60.0000.04012.36
4.4.50.0000.02712.36
4.4.40.0070.02712.36
4.4.30.0030.03312.36
4.4.20.0000.03312.36
4.4.10.0130.02312.36
4.4.00.0030.04712.36
4.3.110.0000.03312.36
4.3.100.0000.02712.36
4.3.90.0030.02012.36
4.3.80.0000.04012.36
4.3.70.0000.02312.36
4.3.60.0070.01712.36
4.3.50.0070.02712.36
4.3.40.0000.04312.36
4.3.30.0000.03712.36
4.3.20.0000.03312.36
4.3.10.0000.04012.36
4.3.00.0030.02012.36

preferences:
40.51 ms | 401 KiB | 5 Q