3v4l.org

run code in 300+ PHP versions simultaneously
<?php function substr_count_array( $haystack, $needle ) { $count = 0; foreach ($needle as $substring) { $count += substr_count( $haystack, $substring); } return $count; } $str = 'The fox jumped over the table and ate a frog'; $search = 'fox ate apple'; $words = explode(' ', $search); $result = substr_count_array($str, $words); if(($result / count($words)) * 100 > 50) { echo 'Related to your query (Total words: '.$words.', Words found: '.$result.')'; } else { echo 'Could not find anything related'; }

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.0070.00716.63
8.3.50.0090.00722.12
8.3.40.0110.00318.89
8.3.30.0070.00719.14
8.3.20.0000.00820.28
8.3.10.0080.00023.48
8.3.00.0030.00620.96
8.2.180.0120.00316.63
8.2.170.0090.00622.96
8.2.160.0100.00320.43
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0120.00626.16
8.2.120.0080.00020.98
8.2.110.0060.00322.26
8.2.100.0080.00320.39
8.2.90.0100.00019.30
8.2.80.0060.00317.97
8.2.70.0060.00317.75
8.2.60.0080.00317.78
8.2.50.0030.00618.07
8.2.40.0050.00520.07
8.2.30.0030.00718.40
8.2.20.0040.00417.62
8.2.10.0000.00818.23
8.2.00.0000.00817.74
8.1.280.0060.00925.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.98
8.1.230.0030.00718.97
8.1.220.0040.00417.77
8.1.210.0040.00418.77
8.1.200.0000.01117.23
8.1.190.0080.00017.13
8.1.180.0080.00018.10
8.1.170.0080.00018.64
8.1.160.0060.00322.02
8.1.150.0000.00718.71
8.1.140.0000.00717.55
8.1.130.0000.00717.82
8.1.120.0000.00717.52
8.1.110.0070.00017.42
8.1.100.0050.00517.48
8.1.90.0000.00817.41
8.1.80.0040.00317.51
8.1.70.0000.00717.45
8.1.60.0040.00417.57
8.1.50.0030.00617.54
8.1.40.0000.00717.45
8.1.30.0000.01117.65
8.1.20.0060.00317.66
8.1.10.0040.00417.39
8.1.00.0040.00417.46
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0040.00418.32
8.0.270.0000.00717.13
8.0.260.0000.00617.17
8.0.250.0030.00317.01
8.0.240.0000.00816.91
8.0.230.0020.00516.96
8.0.220.0000.00716.95
8.0.210.0030.00316.91
8.0.200.0040.00417.05
8.0.190.0070.00017.06
8.0.180.0000.00717.06
8.0.170.0040.00416.90
8.0.160.0030.00316.91
8.0.150.0040.00716.82
8.0.140.0040.00416.95
8.0.130.0000.00513.36
8.0.120.0000.00716.91
8.0.110.0050.00216.98
8.0.100.0000.00817.01
8.0.90.0040.00416.91
8.0.80.0070.00816.95
8.0.70.0000.00717.07
8.0.60.0040.00416.93
8.0.50.0030.00316.79
8.0.30.0110.00817.07
8.0.20.0110.00817.40
8.0.10.0050.00317.04
8.0.00.0080.01116.82
7.4.330.0030.00315.19
7.4.320.0030.00316.52
7.4.300.0000.00616.66
7.4.290.0070.00316.48
7.4.280.0070.00316.50
7.4.270.0000.00716.56
7.4.260.0000.00916.63
7.4.250.0040.00416.61
7.4.240.0040.00416.56
7.4.230.0040.00416.34
7.4.220.0030.01416.63
7.4.210.0100.01016.52
7.4.200.0070.00016.45
7.4.160.0050.01116.63
7.4.150.0180.00617.40
7.4.140.0050.01217.86
7.4.130.0070.01016.39
7.4.120.0110.00816.54
7.4.110.0030.01316.54
7.4.100.0070.01016.59
7.4.90.0120.00616.59
7.4.80.0070.02119.39
7.4.70.0100.00716.59
7.4.60.0000.01816.31
7.4.50.0020.00216.39
7.4.40.0120.00416.61
7.4.30.0060.00916.62
7.4.00.0060.01014.92
7.3.330.0030.00313.30
7.3.320.0030.00313.38
7.3.310.0080.00016.43
7.3.300.0000.00716.40
7.3.290.0000.01316.43
7.3.280.0070.00916.42
7.3.270.0000.01717.40
7.3.260.0120.00616.53
7.3.250.0100.01316.53
7.3.240.0080.00816.67
7.3.230.0100.00616.48
7.3.210.0160.00016.46
7.3.200.0120.00619.39
7.3.190.0160.00016.60
7.3.180.0090.00616.52
7.3.170.0080.00716.61
7.3.160.0080.00816.40
7.3.120.0050.01116.08
7.3.110.0030.01416.03
7.3.100.0070.00716.04
7.3.90.0040.01016.04
7.3.80.0040.01116.03
7.3.70.0020.01516.03
7.3.60.0060.00916.01
7.3.50.0050.01115.91
7.3.40.0060.00715.99
7.3.30.0060.01015.97
7.3.20.0070.00716.97
7.3.10.0040.01016.79
7.3.00.0070.00716.90
7.2.330.0070.01016.72
7.2.320.0110.00616.80
7.2.310.0130.00316.50
7.2.300.0030.01316.80
7.2.290.0070.01016.70
7.2.250.0100.01014.81
7.2.240.0060.01016.16
7.2.230.0040.01116.15
7.2.220.0080.00816.10
7.2.210.0070.00816.14
7.2.200.0080.00516.16
7.2.190.0000.01716.08
7.2.180.0040.01415.99
7.2.170.0090.00716.13
7.2.160.0000.01817.15
7.2.150.0070.01017.15
7.2.140.0090.00917.15
7.2.130.0030.00917.15
7.2.120.0030.01017.15
7.2.110.0030.01317.15
7.2.100.0070.01017.15
7.2.90.0070.01117.15
7.2.80.0060.01117.15
7.2.70.0070.01017.15
7.2.60.0030.01017.15
7.2.50.0030.00917.15
7.2.40.0070.01117.15
7.2.30.0070.01117.15
7.2.20.0070.00717.15
7.2.10.0070.00717.15
7.2.00.0090.00917.15
7.1.330.0060.01016.43
7.1.320.0070.00816.52
7.1.310.0070.00816.29
7.1.300.0110.00516.32
7.1.290.0020.01016.42
7.1.280.0050.00916.47
7.1.270.0050.00716.46
7.1.260.0070.00816.48
7.1.250.0110.00417.15
7.1.70.0000.01017.20
7.1.60.0030.02019.70
7.1.50.0130.00916.95
7.1.00.0100.07022.57
7.0.200.0320.00714.63
7.0.140.0170.06022.12
7.0.60.0130.07019.97
7.0.50.0100.07717.96
7.0.40.0070.04320.26
7.0.30.0200.04720.10
7.0.20.0200.08320.16
7.0.10.0170.08020.45
7.0.00.0130.07320.11
5.6.280.0000.07720.91
5.6.210.0130.08020.62
5.6.200.0100.07018.17
5.6.190.0030.06720.33
5.6.180.4200.03720.63
5.6.170.0200.05720.62
5.6.160.0100.08320.33
5.6.150.0030.05318.25
5.6.140.0070.05718.12
5.6.130.0030.08318.14
5.6.120.0100.04321.02
5.6.110.0130.06720.89
5.6.100.0100.07720.99
5.6.90.0100.08321.11
5.6.80.0130.07320.40
5.6.70.0070.05720.38
5.5.350.0300.05320.41
5.5.340.0070.08017.99
5.5.330.0030.04720.43
5.5.320.0370.03720.29
5.5.310.0230.08020.30
5.5.300.0100.06718.02
5.5.290.0030.06717.98
5.5.280.0070.07020.98
5.5.270.0000.05020.77
5.5.260.0130.04320.73
5.5.250.0070.07720.77
5.5.240.0130.06020.13
5.4.450.0270.05029.48
5.4.440.0470.04328.29
5.4.430.0270.04728.29
5.4.420.0700.03328.29
5.4.410.0430.04028.29
5.4.400.0370.03728.29
5.4.390.0600.04028.28
5.4.380.0200.05318.61
5.4.370.0130.05318.49
5.4.360.0130.05318.84
5.4.350.0170.05318.70
5.4.340.0230.04318.49
5.4.320.0060.03812.50
5.4.310.0060.04412.50
5.4.300.0070.04412.50
5.4.290.0060.04912.50
5.4.280.0070.04312.39
5.4.270.0100.04212.40
5.4.260.0040.04712.40
5.4.250.0060.04512.40
5.4.240.0060.04612.40
5.4.230.0080.04312.39
5.4.220.0110.04112.39
5.4.210.0160.03412.39
5.4.200.0100.04212.38
5.4.190.0050.04312.39
5.4.180.0140.03712.39
5.4.170.0070.04512.39
5.4.160.0090.04212.39
5.4.150.0120.03812.39
5.4.140.0110.05112.07
5.4.130.0120.04612.05
5.4.120.0090.05912.02
5.4.110.0060.05412.01
5.4.100.0070.04612.02
5.4.90.0050.04212.01
5.4.80.0040.04112.01
5.4.70.0030.03912.01
5.4.60.0080.03712.01
5.4.50.0070.03512.01
5.4.40.0090.03212.00
5.4.30.0080.03511.99
5.4.20.0070.04111.99
5.4.10.0070.03711.99
5.4.00.0060.03611.48
5.3.290.0060.04312.80
5.3.280.0060.04012.71
5.3.270.0080.04112.72
5.3.260.0080.04412.72
5.3.250.0080.04212.72
5.3.240.0070.03912.72
5.3.230.0060.04312.71
5.3.220.0070.04312.68
5.3.210.0060.04512.68
5.3.200.0070.04012.68
5.3.190.0090.04412.68
5.3.180.0050.03912.67
5.3.170.0040.04112.66
5.3.160.0110.04512.67
5.3.150.0080.05212.68
5.3.140.0100.04312.66
5.3.130.0100.05012.66
5.3.120.0080.05312.66
5.3.110.0090.04612.66
5.3.100.0100.04412.12
5.3.90.0140.04412.10
5.3.80.0100.04912.09
5.3.70.0110.04712.09
5.3.60.0080.04412.07
5.3.50.0090.04812.02
5.3.40.0120.05012.02
5.3.30.0140.03711.98
5.3.20.0070.04511.78
5.3.10.0080.04311.73
5.3.00.0110.04611.72
5.2.170.0150.0349.22
5.2.160.0080.0369.22
5.2.150.0090.0309.22
5.2.140.0090.0299.21
5.2.130.0040.0339.17
5.2.120.0080.0329.17
5.2.110.0050.0339.18
5.2.100.0070.0389.18
5.2.90.0070.0439.18
5.2.80.0070.0339.17
5.2.70.0000.0399.17
5.2.60.0060.0339.13
5.2.50.0070.0369.09
5.2.40.0090.0279.07
5.2.30.0050.0339.05
5.2.20.0040.0329.04
5.2.10.0070.0298.94
5.2.00.0110.0418.80
5.1.60.0050.0298.09
5.1.50.0050.0328.09
5.1.40.0060.0308.07
5.1.30.0050.0358.41
5.1.20.0070.0278.44
5.1.10.0100.0288.16
5.1.00.0050.0348.16
5.0.50.0050.0226.64
5.0.40.0030.0246.50
5.0.30.0030.0336.31
5.0.20.0040.0196.28
5.0.10.0050.0186.26
5.0.00.0030.0316.25
4.4.90.0050.0144.77
4.4.80.0040.0144.75
4.4.70.0020.0174.76
4.4.60.0020.0174.76
4.4.50.0040.0174.77
4.4.40.0060.0264.71
4.4.30.0060.0134.76
4.4.20.0020.0174.84
4.4.10.0030.0174.85
4.4.00.0060.0224.76
4.3.110.0030.0164.66
4.3.100.0000.0204.66
4.3.90.0080.0124.63
4.3.80.0050.0244.58
4.3.70.0030.0154.63
4.3.60.0040.0134.63
4.3.50.0020.0164.63
4.3.40.0060.0304.54
4.3.30.0040.0203.30
4.3.20.0030.0213.28
4.3.10.0030.0203.24
4.3.00.0070.01729.93

preferences:
70.38 ms | 401 KiB | 5 Q