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) . "\n"; $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) . "\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.0100.02014.62
7.4.00.0090.01915.23
7.3.130.0060.01914.84
7.3.120.0060.02515.02
7.3.110.0030.03014.96
7.3.100.0150.00914.60
7.3.90.0060.01914.73
7.3.80.0070.01314.75
7.3.70.0100.01714.66
7.3.60.0000.01814.82
7.3.50.0070.01714.81
7.3.40.0090.01514.91
7.3.30.0000.02414.93
7.3.20.0060.01916.77
7.3.10.0030.02416.66
7.3.00.0080.01416.50
7.2.260.0000.02715.07
7.2.250.0100.02315.24
7.2.240.0060.01915.14
7.2.230.0070.02015.17
7.2.220.0090.02515.23
7.2.210.0060.01514.88
7.2.200.0070.02014.97
7.2.190.0110.01114.91
7.2.180.0070.01715.08
7.2.170.0070.02014.99
7.2.160.0000.02214.87
7.2.150.0000.02516.93
7.2.140.0000.02417.07
7.2.130.0060.02016.91
7.2.120.0040.02016.83
7.2.110.0050.02016.94
7.2.100.0060.01917.01
7.2.90.0030.02217.02
7.2.80.0080.01816.90
7.2.70.0090.01716.83
7.2.60.0070.01616.99
7.2.50.0110.01716.99
7.2.40.0060.01716.86
7.2.30.0070.01816.90
7.2.20.0050.02216.93
7.2.10.0070.02017.02
7.2.00.0070.01817.80
7.1.330.0100.02215.85
7.1.320.0100.02915.90
7.1.310.0030.02615.88
7.1.300.0030.02515.67
7.1.290.0040.02815.96
7.1.280.0100.02015.71
7.1.270.0120.01915.73
7.1.260.0030.02615.79
7.1.250.0050.02615.99
7.1.240.0070.02415.91
7.1.230.0000.03315.65
7.1.220.0030.02815.44
7.1.210.0140.02015.58
7.1.200.0030.02715.60
7.1.190.0040.02115.90
7.1.180.0100.02115.61
7.1.170.0030.02515.79
7.1.160.0060.02915.68
7.1.150.0070.03016.00
7.1.140.0120.02115.94
7.1.130.0060.02615.83
7.1.120.0030.02615.84
7.1.110.0090.02515.99
7.1.100.0070.02315.92
7.1.90.0100.02615.99
7.1.80.0100.02915.80
7.1.70.0030.01916.56
7.1.60.0080.02217.80
7.1.50.0050.02716.44
7.1.40.0030.02615.91
7.1.30.0030.03015.55
7.1.20.0000.02615.53
7.1.10.0030.02915.55
7.1.00.0030.06519.13
7.0.330.0090.02515.47
7.0.320.0000.03215.43
7.0.310.0060.02815.20
7.0.300.0160.01915.41
7.0.290.0070.02715.56
7.0.280.0070.03015.57
7.0.270.0000.03015.46
7.0.260.0070.02715.41
7.0.250.0070.02615.52
7.0.240.0070.02315.17
7.0.230.0070.03515.48
7.0.220.0100.02315.26
7.0.210.0070.02415.46
7.0.200.0020.02516.04
7.0.190.0030.03115.57
7.0.180.0030.02715.31
7.0.170.0040.02815.48
7.0.160.0000.03415.36
7.0.150.0000.03515.40
7.0.140.0020.05818.63
7.0.130.0030.02815.57
7.0.120.0000.03315.55
7.0.110.0030.02415.18
7.0.100.0260.05817.76
7.0.90.0250.05417.68
7.0.80.0270.05917.67
7.0.70.0260.05317.64
7.0.60.0250.05417.67
7.0.50.0180.05617.94
7.0.40.0080.05516.77
7.0.30.0130.06016.84
7.0.20.0150.05916.62
7.0.10.0070.05616.70
7.0.00.0080.03816.79
5.6.400.0000.05714.39
5.6.390.0030.05814.61
5.6.380.0070.04614.42
5.6.370.0100.05114.39
5.6.360.0030.05014.17
5.6.350.0030.05214.55
5.6.340.0030.05314.73
5.6.330.0030.04714.45
5.6.320.0070.04414.14
5.6.310.0030.05114.21
5.6.300.0070.04514.63
5.6.290.0030.05514.07
5.6.280.0070.07817.62
5.6.270.0030.05214.25
5.6.260.0100.04514.20
5.6.250.0050.08117.61
5.6.240.0110.07517.40
5.6.230.0080.08217.54
5.6.220.0080.08517.59
5.6.210.0120.07217.67
5.6.200.0120.08017.75
5.6.190.0100.07817.70
5.6.180.0050.08017.67
5.6.170.0110.07417.76
5.6.160.0070.06317.76
5.6.150.0080.07817.75
5.6.140.0100.07917.61
5.6.130.0100.07217.54
5.6.120.0030.08017.72
5.6.110.0070.08017.81
5.6.100.0080.07517.73
5.6.90.0050.08617.62
5.6.80.0030.08617.26
5.6.70.0080.07917.43
5.6.60.0100.07317.22
5.6.50.0130.06917.25
5.6.40.0100.07717.43
5.6.30.0100.07517.40
5.6.20.0070.07317.37
5.6.10.0080.07517.46
5.6.00.0080.07917.29
5.5.380.0080.07917.17
5.5.370.0070.08017.28
5.5.360.0070.08317.42
5.5.350.0020.08417.24
5.5.340.0070.07617.55
5.5.330.0100.07817.57
5.5.320.0050.07717.44
5.5.310.0060.06417.58
5.5.300.0050.08517.61
5.5.290.0100.07817.69
5.5.280.0050.07817.70
5.5.270.0080.07917.55
5.5.260.0080.07517.72
5.5.250.0080.06317.46
5.5.240.0100.07717.22
5.5.230.0080.07817.27
5.5.220.0080.07617.29
5.5.210.0080.07017.18
5.5.200.0060.07917.28
5.5.190.0080.08117.23
5.5.180.0080.07917.02
5.5.170.0030.04813.98
5.5.160.0050.08317.24
5.5.150.0070.07617.17
5.5.140.0050.07717.33
5.5.130.0050.07817.30
5.5.120.0000.08817.28
5.5.110.0120.07117.26
5.5.100.0020.07917.24
5.5.90.0080.08017.11
5.5.80.0080.07417.28
5.5.70.0070.07917.02
5.5.60.0030.08217.14
5.5.50.0070.08017.18
5.5.40.0100.07317.08
5.5.30.0030.06817.15
5.5.20.0070.05317.14
5.5.10.0050.06417.14
5.5.00.0030.06317.21
5.4.450.0050.07915.18
5.4.440.0050.08215.08
5.4.430.0120.07915.28
5.4.420.0050.08315.18
5.4.410.0030.07814.95
5.4.400.0080.07715.10
5.4.390.0130.06914.97
5.4.380.0100.07414.97
5.4.370.0030.08515.03
5.4.360.0070.08014.99
5.4.350.0050.08315.02
5.4.340.0080.06614.96
5.4.330.0070.04611.13
5.4.320.0030.07915.04
5.4.310.0030.07714.88
5.4.300.0050.08215.16
5.4.290.0050.08314.97
5.4.280.0050.07414.99
5.4.270.0030.07814.95
5.4.260.0030.08114.93
5.4.250.0030.07714.86
5.4.240.0130.06815.13
5.4.230.0030.08314.85
5.4.220.0050.08514.78
5.4.210.0080.08115.10
5.4.200.0050.05815.06
5.4.190.0030.06215.04
5.4.180.0070.07814.75
5.4.170.0070.05414.86
5.4.160.0070.05014.96
5.4.150.0070.05814.89
5.4.140.0030.08113.59
5.4.130.0030.05613.47
5.4.120.0050.05413.51
5.4.110.0050.05613.63
5.4.100.0020.05513.57
5.4.90.0070.06313.53
5.4.80.0030.05613.71
5.4.70.0030.05113.72
5.4.60.0030.06213.48
5.4.50.0030.06413.72
5.4.40.0030.06013.53
5.4.30.0020.07613.72
5.4.20.0030.07113.63
5.4.10.0050.06813.48
5.4.00.0100.06613.37
5.3.290.0000.04612.38
5.3.280.0050.03812.40
5.3.270.0020.02712.37
5.3.260.0000.02412.40
5.3.250.0030.01912.33
5.3.240.0030.02012.31
5.3.230.0020.02412.30
5.3.220.0030.02012.31
5.3.210.0030.03312.35
5.3.200.0030.02212.27
5.3.190.0060.03712.36
5.3.180.0080.01812.32
5.3.170.0050.04012.40
5.3.160.0030.02112.42
5.3.150.0040.02412.39
5.3.140.0030.02512.34
5.3.130.0020.02212.32
5.3.120.0030.03012.30
5.3.110.0080.03612.30
5.3.100.0050.03912.05
5.3.90.0050.02012.08
5.3.80.0070.01812.02
5.3.70.0030.03511.89
5.3.60.0040.02712.06
5.3.50.0030.02512.04
5.3.40.0030.02411.94
5.3.30.0030.03811.99
5.3.20.0030.01911.76
5.3.10.0070.03211.66
5.3.00.0050.02211.78
5.2.170.0000.04011.14
5.2.160.0000.03011.16
5.2.150.0030.03011.13
5.2.140.0030.03311.14
5.2.130.0030.03311.16
5.2.120.0030.02710.95
5.2.110.0000.03011.09
5.2.100.0070.05310.92
5.2.90.0030.04711.07
5.2.80.0030.06011.02
5.2.70.0070.05011.14
5.2.60.0000.06010.84
5.2.50.0030.03011.02
5.2.40.0070.05010.81
5.2.30.0000.05710.97
5.2.20.0030.06010.81
5.2.10.0070.05710.77
5.2.00.0100.05310.76
5.1.60.0100.05010.01
5.1.50.0070.05310.01
5.1.40.0030.05010.06
5.1.30.0030.05710.38
5.1.20.0070.05310.37
5.1.10.0030.05010.09
5.1.00.0070.04710.12
5.0.50.0030.0478.58
5.0.40.0030.0438.29
5.0.30.0000.0678.25
5.0.20.0070.0378.21
5.0.10.0000.0478.17
5.0.00.0130.0578.17
4.4.90.0000.0178.17
4.4.80.0030.0208.17
4.4.70.0030.0378.17
4.4.60.0100.0278.17
4.4.50.0070.0308.17
4.4.40.0000.0538.17
4.4.30.0030.0338.17
4.4.20.0030.0378.17
4.4.10.0030.0378.17
4.4.00.0070.0408.17
4.3.110.0030.0378.17
4.3.100.0000.0278.17
4.3.90.0000.0308.17
4.3.80.0030.0508.17
4.3.70.0000.0378.17
4.3.60.0000.0378.17
4.3.50.0000.0308.17
4.3.40.0000.0578.17
4.3.30.0070.0308.17
4.3.20.0000.0378.17
4.3.10.0030.0278.17
4.3.00.0070.0308.17

preferences:
42.11 ms | 401 KiB | 5 Q