3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str="This is a test - That game is awesome (Cristiano Ronaldo is a great Soccer Player)"; //clean string: $str=preg_replace("/[^A-Za-z0-9 ]/", '', $str); //first explode it $e=explode(' ',$str); //loop to remove short words $out=array(); foreach ($e as $a){ if(strlen($a)>2){ $out[]=$a; } } $list = array( "This" => "9", "great" => "10", "God Father" => "11", "Tony Montana" => "12", "Ronaldo" => "13", "Al Pacino" => "14", "Humans" => "15", "Play" => "16" ); foreach ($out as $keyword) { foreach ($list as $word=>$num) { $sim_chars = similar_text($keyword, $word); if ($sim_chars/strlen($keyword) > .8 || $sim_chars/strlen($word) > .8) { $all_key_values[] = $num; $all_keys[] = $word; } elseif (stripos($keyword, $word) !== false || strpos($word, $keyword) !== false) { $sll_key_values[] = $num; $all_keys[] = $word; } } } print_r(implode(',', $all_key_values)); print_r(implode(',', $all_keys));

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.0110.00418.30
8.3.50.0090.00822.25
8.3.40.0100.01319.09
8.3.30.0070.01019.07
8.3.20.0040.00420.30
8.3.10.0040.00423.42
8.3.00.0060.00319.63
8.2.180.0110.01116.63
8.2.170.0060.00922.96
8.2.160.0140.00320.40
8.2.150.0000.00824.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0070.00022.37
8.2.110.0060.00319.38
8.2.100.0000.01117.72
8.2.90.0000.00819.36
8.2.80.0040.00417.97
8.2.70.0070.00317.88
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0050.00320.01
8.2.30.0000.00718.04
8.2.20.0030.00617.95
8.2.10.0040.00418.04
8.2.00.0040.00417.79
8.1.280.0090.00925.92
8.1.270.0120.00023.83
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.89
8.1.230.0110.00021.10
8.1.220.0000.00918.82
8.1.210.0030.00518.98
8.1.200.0070.00317.47
8.1.190.0080.00017.47
8.1.180.0000.00819.08
8.1.170.0040.00418.62
8.1.160.0000.00721.94
8.1.150.0030.00618.79
8.1.140.0050.00317.61
8.1.130.0000.00717.78
8.1.120.0040.00417.45
8.1.110.0000.00717.66
8.1.100.0000.00817.47
8.1.90.0000.00717.68
8.1.80.0040.00417.61
8.1.70.0070.00017.47
8.1.60.0080.00017.63
8.1.50.0050.00317.61
8.1.40.0040.00417.70
8.1.30.0030.00617.80
8.1.20.0040.00417.80
8.1.10.0040.00417.69
8.1.00.0040.00417.58
8.0.300.0040.00420.02
8.0.290.0000.00817.18
8.0.280.0000.00718.51
8.0.270.0050.00217.02
8.0.260.0000.00617.32
8.0.250.0030.00317.15
8.0.240.0000.00717.13
8.0.230.0070.00017.00
8.0.220.0030.00317.04
8.0.210.0030.00317.07
8.0.200.0000.00817.11
8.0.190.0050.00317.15
8.0.180.0040.00417.02
8.0.170.0050.00317.07
8.0.160.0000.00717.07
8.0.150.0000.00717.01
8.0.140.0000.00816.92
8.0.130.0030.00313.46
8.0.120.0040.00417.05
8.0.110.0040.00416.99
8.0.100.0060.00317.09
8.0.90.0040.00417.04
8.0.80.0030.01316.94
8.0.70.0060.00316.99
8.0.60.0000.00016.94
8.0.50.0040.00416.95
8.0.30.0170.00517.24
8.0.20.0150.00817.43
8.0.10.0040.00417.24
8.0.00.0120.00716.91
7.4.330.0030.00315.00
7.4.320.0070.00016.82
7.4.300.0070.00016.68
7.4.290.0030.00316.75
7.4.280.0040.00416.73
7.4.270.0030.00316.68
7.4.260.0000.00816.73
7.4.250.0020.00516.76
7.4.240.0040.00316.67
7.4.230.0070.00016.73
7.4.220.0100.01616.63
7.4.210.0060.00816.83
7.4.200.0050.00216.83
7.4.190.0000.00716.87
7.4.160.0030.01216.96
7.4.150.0130.00317.40
7.4.140.0120.00617.86
7.4.130.0050.01216.72
7.4.120.0070.01116.78
7.4.110.0070.01116.63
7.4.100.0120.00616.45
7.4.90.0030.01416.68
7.4.80.0110.01419.39
7.4.70.0070.01016.75
7.4.60.0100.00716.68
7.4.50.0000.00516.49
7.4.40.0030.02016.61
7.4.30.0050.01116.63
7.4.10.0030.01615.10
7.4.00.0080.01015.30
7.3.330.0030.00513.33
7.3.320.0060.00013.23
7.3.310.0070.00016.49
7.3.300.0030.00316.48
7.3.290.0070.00716.51
7.3.280.0050.01516.50
7.3.270.0070.01017.40
7.3.260.0170.00716.41
7.3.250.0100.00716.63
7.3.240.0120.00516.65
7.3.230.0030.01316.57
7.3.210.0000.01816.64
7.3.200.0130.00719.39
7.3.190.0080.00416.41
7.3.180.0040.01216.76
7.3.170.0080.00816.61
7.3.160.0110.00516.54
7.3.130.0060.01014.92
7.3.120.0060.01215.02
7.3.110.0080.00814.98
7.3.100.0080.00715.02
7.3.90.0080.00715.20
7.3.80.0040.00915.09
7.3.70.0070.00614.99
7.3.60.0060.00715.05
7.3.50.0100.00415.06
7.3.40.0060.00814.91
7.3.30.0020.01115.09
7.3.20.0060.00816.80
7.3.10.0040.00916.76
7.3.00.0030.01116.79
7.2.330.0080.01616.75
7.2.320.0150.00316.91
7.2.310.0130.00316.98
7.2.300.0060.01116.92
7.2.290.0070.01016.81
7.2.260.0080.00915.48
7.2.250.0060.01215.13
7.2.240.0070.00915.24
7.2.230.0090.00615.30
7.2.220.0090.00515.29
7.2.210.0080.00815.20
7.2.200.0070.01015.31
7.2.190.0060.00815.27
7.2.180.0060.00715.27
7.2.170.0060.00715.15
7.2.160.0060.00715.21
7.2.150.0070.00617.01
7.2.140.0050.00717.13
7.2.130.0040.01117.11
7.2.120.0060.01016.95
7.2.110.0030.01117.13
7.2.100.0070.00716.96
7.2.90.0040.01117.16
7.2.80.0090.00817.05
7.2.70.0080.00717.27
7.2.60.0100.00517.03
7.2.50.0080.00817.15
7.2.40.0090.00617.04
7.2.30.0080.00717.10
7.2.20.0070.00717.05
7.2.10.0020.01017.18
7.2.00.0030.01017.00
7.1.330.0050.01115.87
7.1.320.0030.01016.01
7.1.310.0010.01115.97
7.1.300.0050.00715.92
7.1.290.0060.00815.93
7.1.280.0050.00815.88
7.1.270.0060.00815.89
7.1.260.0040.00616.08
7.1.250.0050.01215.91
7.1.240.0080.00316.06
7.1.230.0050.00916.02
7.1.220.0070.00416.04
7.1.210.0060.00615.97
7.1.200.0100.00415.91
7.1.190.0040.00915.92
7.1.180.0090.00815.92
7.1.170.0060.00715.83
7.1.160.0030.00616.00
7.1.150.0050.00615.79
7.1.140.0100.00315.88
7.1.130.0050.00815.86
7.1.120.0040.00916.00
7.1.110.0060.00816.13
7.1.100.0060.00616.59
7.1.90.0060.00816.00
7.1.80.0040.01116.04
7.1.70.0060.00616.45
7.1.60.0070.00917.03
7.1.50.0060.00916.37
7.1.40.0050.00415.85
7.1.30.0040.00916.05
7.1.20.0060.00615.93
7.1.10.0040.00915.97
7.1.00.0040.03018.13
7.0.330.0060.01015.50
7.0.320.0020.01415.42
7.0.310.0020.01015.68
7.0.300.0030.01215.59
7.0.290.0070.00415.73
7.0.280.0030.00715.45
7.0.270.0080.00615.68
7.0.260.0050.00915.61
7.0.250.0050.00715.68
7.0.240.0090.00515.72
7.0.230.0020.00915.63
7.0.220.0070.00815.66
7.0.210.0050.01015.44
7.0.200.0020.00916.13
7.0.190.0090.00215.46
7.0.180.0060.00415.58
7.0.170.0030.01215.62
7.0.160.0030.00615.46
7.0.150.0070.00715.47
7.0.140.0040.02817.82
7.0.130.0020.01115.71
7.0.120.0030.01015.78
7.0.110.0080.00515.58
7.0.100.0050.00715.39
7.0.90.0060.00815.61
7.0.80.0070.00515.55
7.0.70.0050.00715.48
7.0.60.0070.01717.09
7.0.50.0080.01716.47
7.0.40.0060.02015.89
7.0.30.0120.03115.88
7.0.20.0090.02215.88
7.0.10.0050.02015.81
7.0.00.0050.03415.84
5.6.400.0060.00814.37
5.6.390.0050.00814.65
5.6.380.0050.00814.50
5.6.370.0040.01114.58
5.6.360.0050.00614.48
5.6.350.0030.01014.64
5.6.340.0070.00514.65
5.6.330.0070.00914.60
5.6.320.0030.01014.65
5.6.310.0030.01414.32
5.6.300.0070.00514.45
5.6.290.0060.00514.71
5.6.280.0050.03016.68
5.6.270.0060.00514.63
5.6.260.0060.00614.53
5.6.250.0080.00514.64
5.6.240.0060.00814.52
5.6.230.0060.00814.39
5.6.220.0040.00914.38
5.6.210.0070.01816.55
5.6.200.0090.03615.70
5.6.190.0060.01916.39
5.6.180.0110.02416.52
5.6.170.0140.01716.51
5.6.160.0070.02316.56
5.6.150.0040.02515.72
5.6.140.0030.02615.58
5.6.130.0050.03015.77
5.6.120.0050.02216.66
5.6.110.0090.02916.69
5.6.100.0120.02116.78
5.6.90.0080.02916.75
5.6.80.0090.02416.46
5.6.70.0050.01214.47
5.6.60.0040.01114.47
5.6.50.0050.01014.39
5.6.40.0070.00514.65
5.6.30.0100.00514.35
5.6.20.0080.00514.33
5.6.10.0070.00514.56
5.6.00.0080.00514.49
5.5.380.0030.01214.23
5.5.370.0030.01314.37
5.5.360.0050.00914.56
5.5.350.0120.01816.60
5.5.340.0050.01915.78
5.5.330.0060.03116.48
5.5.320.0090.03216.37
5.5.310.0130.02916.36
5.5.300.0050.02315.52
5.5.290.0060.03415.61
5.5.280.0050.03416.63
5.5.270.0090.01916.59
5.5.260.0060.03316.62
5.5.250.0040.02516.56
5.5.240.0110.02316.38
5.5.230.0050.00714.43
5.5.220.0080.00514.48
5.5.210.0090.00514.43
5.5.200.0050.00614.45
5.5.190.0070.00614.37
5.5.180.0030.01014.28
5.5.170.0050.01314.36
5.5.160.0070.00714.51
5.5.150.0030.01214.25
5.5.140.0060.00914.48
5.5.130.0090.00514.20
5.5.120.0040.00714.48
5.5.110.0080.00414.22
5.5.100.0050.01014.33
5.5.90.0050.00814.32
5.5.80.0050.00814.19
5.5.70.0050.00714.45
5.5.60.0050.01114.27
5.5.50.0040.01014.34
5.5.40.0030.01014.31
5.5.30.0070.01014.27
5.5.20.0050.00814.47
5.5.10.0070.00714.06
5.5.00.0020.01414.44
5.4.450.0260.02414.63
5.4.440.0320.02214.80
5.4.430.0090.01914.79
5.4.420.0070.02214.72
5.4.410.0030.02614.75
5.4.400.0050.02614.87
5.4.390.0020.02314.64
5.4.380.0140.02114.48
5.4.370.0130.01714.61
5.4.360.0120.02114.54
5.4.350.0160.01714.51
5.4.340.0100.02314.39
5.4.330.0070.00712.53
5.4.320.0060.01912.43
5.4.310.0050.02512.39
5.4.300.0050.02012.42
5.4.290.0030.02412.42
5.4.280.0080.01912.42
5.4.270.0040.02212.40
5.4.260.0060.02612.44
5.4.250.0080.02512.45
5.4.240.0020.02712.36
5.4.230.0060.02512.39
5.4.220.0070.02312.43
5.4.210.0060.02512.43
5.4.200.0070.02412.50
5.4.190.0050.02612.40
5.4.180.0040.02312.30
5.4.170.0080.02112.44
5.4.160.0070.01912.35
5.4.150.0060.02612.48
5.4.140.0100.02212.32
5.4.130.0060.02712.28
5.4.120.0040.02712.28
5.4.110.0060.02512.32
5.4.100.0100.02212.26
5.4.90.0030.02012.29
5.4.80.0020.02112.27
5.4.70.0060.01512.29
5.4.60.0030.01812.33
5.4.50.0080.01612.26
5.4.40.0090.01312.24
5.4.30.0080.02012.32
5.4.20.0080.02212.25
5.4.10.0080.01712.27
5.4.00.0050.01912.10
5.3.290.0040.02212.35
5.3.280.0050.01712.34
5.3.270.0050.01712.37
5.3.260.0040.01912.36
5.3.250.0100.02912.42
5.3.240.0060.02212.33
5.3.230.0050.01712.27
5.3.220.0060.02012.34
5.3.210.0090.02012.28
5.3.200.0070.03112.38
5.3.190.0050.02512.38
5.3.180.0060.02212.33
5.3.170.0080.02112.37
5.3.160.0080.02012.41
5.3.150.0050.01912.33
5.3.140.0080.01512.32
5.3.130.0040.02112.37
5.3.120.0060.02412.39
5.3.110.0060.02312.39
5.3.100.0060.02012.18
5.3.90.0050.02312.19
5.3.80.0050.02412.12
5.3.70.0060.02212.11
5.3.60.0030.02412.19
5.3.50.0090.01912.08
5.3.40.0080.01812.08
5.3.30.0050.02212.07
5.3.20.0070.02211.98
5.3.10.0070.01911.93
5.3.00.0090.01711.93
5.2.170.0100.0429.20
5.2.160.0050.0329.20
5.2.150.0070.0319.20
5.2.140.0050.0329.20
5.2.130.0040.0319.16
5.2.120.0070.0279.16
5.2.110.0070.0369.16
5.2.100.0050.0319.16
5.2.90.0060.0299.15
5.2.80.0040.0439.15
5.2.70.0110.0379.14
5.2.60.0070.0429.10
5.2.50.0060.0329.07
5.2.40.0050.0369.05
5.2.30.0060.0479.03
5.2.20.0060.0369.02
5.2.10.0060.0408.93
5.2.00.0040.0448.80
5.1.60.0060.0408.08
5.1.50.0060.0368.08
5.1.40.0050.0308.06
5.1.30.0040.0358.41
5.1.20.0120.0508.43
5.1.10.0060.0368.16
5.1.00.0070.0418.16
5.0.50.0050.0296.64
5.0.40.0040.0296.50
5.0.30.0050.0446.31
5.0.20.0070.0306.30
5.0.10.0060.0316.29
5.0.00.0050.0476.28
4.4.90.0040.0244.78
4.4.80.0140.0384.75
4.4.70.0080.0374.76
4.4.60.0040.0234.76
4.4.50.0040.0234.77
4.4.40.0060.0434.71
4.4.30.0040.0304.76
4.4.20.0040.0254.84
4.4.10.0040.0294.85
4.4.00.0040.0284.76
4.3.110.0020.0174.66
4.3.100.0040.0184.67
4.3.90.0050.0204.63
4.3.80.0030.0274.59
4.3.70.0030.0244.63
4.3.60.0030.0234.62
4.3.50.0030.0254.63
4.3.40.0010.0374.54
4.3.30.0030.0163.34
4.3.20.0020.0233.32
4.3.10.0020.0183.27
4.3.00.0030.0238.24

preferences:
35.98 ms | 401 KiB | 5 Q