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; } } print_r($out); $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; } } }

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.70.0070.01116.48
8.3.60.0120.00316.75
8.3.50.0120.00522.08
8.3.40.0110.01118.92
8.3.30.0110.00419.04
8.3.20.0030.00520.13
8.3.10.0040.00723.71
8.3.00.0040.00419.51
8.2.180.0110.01116.50
8.2.170.0170.00322.96
8.2.160.0100.00720.42
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0050.00226.16
8.2.120.0070.00022.13
8.2.110.0040.00422.07
8.2.100.0040.00818.16
8.2.90.0040.00419.35
8.2.80.0060.00318.04
8.2.70.0030.00617.88
8.2.60.0040.00417.91
8.2.50.0030.00618.07
8.2.40.0040.00420.07
8.2.30.0030.00519.93
8.2.20.0000.00817.86
8.2.10.0000.00718.15
8.2.00.0000.00817.90
8.1.280.0090.00625.92
8.1.270.0080.00023.79
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0050.00324.02
8.1.230.0040.00718.89
8.1.220.0080.00017.79
8.1.210.0030.00518.77
8.1.200.0000.00917.34
8.1.190.0070.00417.29
8.1.180.0060.00318.10
8.1.170.0050.00318.55
8.1.160.0060.00321.95
8.1.150.0000.00918.78
8.1.140.0050.00317.63
8.1.130.0030.00317.86
8.1.120.0040.00417.51
8.1.110.0030.00517.64
8.1.100.0030.00317.64
8.1.90.0000.00717.51
8.1.80.0000.00717.57
8.1.70.0030.00317.55
8.1.60.0000.00817.71
8.1.50.0040.00417.59
8.1.40.0000.00817.69
8.1.30.0030.00617.73
8.1.20.0040.00417.63
8.1.10.0040.00417.64
8.1.00.0070.00017.61
8.0.300.0050.00320.52
8.0.290.0070.00017.18
8.0.280.0000.00718.38
8.0.270.0000.00717.15
8.0.260.0000.00717.33
8.0.250.0000.00817.08
8.0.240.0000.00717.04
8.0.230.0040.00417.11
8.0.220.0030.00316.93
8.0.210.0030.00316.90
8.0.200.0040.00417.07
8.0.190.0000.00916.96
8.0.180.0000.00717.10
8.0.170.0000.00817.10
8.0.160.0040.00417.06
8.0.150.0040.00417.05
8.0.140.0040.00416.96
8.0.130.0000.00613.55
8.0.120.0080.00016.91
8.0.110.0000.00817.00
8.0.100.0040.00416.83
8.0.90.0000.00817.15
8.0.80.0060.00917.00
8.0.70.0000.00816.82
8.0.60.0000.00016.89
8.0.50.0040.00417.03
8.0.30.0050.01417.37
8.0.20.0110.00817.40
8.0.10.0070.00017.23
8.0.00.0080.01017.18
7.4.330.0050.00015.00
7.4.320.0030.00316.63
7.4.300.0000.00816.73
7.4.290.0040.00416.58
7.4.280.0040.00416.79
7.4.270.0000.00716.71
7.4.260.0030.00316.73
7.4.250.0040.00416.78
7.4.240.0020.00516.79
7.4.230.0030.00316.86
7.4.220.0180.00916.82
7.4.210.0060.00816.87
7.4.200.0000.00716.86
7.4.190.0030.00316.68
7.4.160.0080.00816.52
7.4.150.0120.00717.40
7.4.140.0090.00917.86
7.4.130.0130.00716.76
7.4.120.0110.00616.80
7.4.110.0090.00916.74
7.4.100.0200.00316.45
7.4.90.0060.01016.69
7.4.80.0120.01319.39
7.4.70.0060.01116.46
7.4.60.0070.01016.67
7.4.50.0030.00316.46
7.4.40.0110.01216.65
7.4.30.0000.01616.77
7.4.00.0030.01215.21
7.3.330.0070.00013.37
7.3.320.0030.00313.23
7.3.310.0040.00416.51
7.3.300.0000.00716.40
7.3.290.0090.00616.52
7.3.280.0090.01216.54
7.3.270.0120.00617.40
7.3.260.0030.01616.59
7.3.250.0090.00916.64
7.3.240.0090.01316.90
7.3.230.0100.00616.54
7.3.210.0100.01016.54
7.3.200.0130.00519.39
7.3.190.0150.00716.54
7.3.180.0070.01016.66
7.3.170.0040.01916.81
7.3.160.0040.01216.78
7.3.120.0000.01614.95
7.2.330.0090.00916.90
7.2.320.0060.01216.95
7.2.310.0030.01616.88
7.2.300.0110.00616.89
7.2.290.0060.01116.83
7.2.60.0100.00717.02
7.2.00.0070.00719.63
7.1.100.0000.01418.37
7.1.70.0030.00917.43
7.1.60.0090.00619.46
7.1.50.0090.01217.07
7.1.00.0070.07322.52
7.0.200.0740.00314.88
7.0.140.0070.07022.00
7.0.60.0100.05020.01
7.0.50.0030.04017.74
7.0.40.0070.04720.12
7.0.30.0300.06720.14
7.0.20.0230.04720.34
7.0.10.0130.03320.24
7.0.00.0030.09320.17
5.6.280.0000.07321.14
5.6.210.0070.04020.51
5.6.200.0000.06018.16
5.6.190.0070.04020.57
5.6.180.0270.07720.62
5.6.170.0330.06320.44
5.6.160.0000.05720.56
5.6.150.0000.04318.17
5.6.140.0070.05018.28
5.6.130.0000.06718.14
5.6.120.0070.04721.04
5.6.110.0000.08720.99
5.6.100.0030.06321.04
5.6.90.0130.04320.97
5.6.80.0070.07720.40
5.5.350.0300.07720.44
5.5.340.0070.04718.09
5.5.330.0130.08020.35
5.5.320.0230.04020.32
5.5.310.0300.07020.26
5.5.300.0200.06717.98
5.5.290.0070.07018.02
5.5.280.0070.06720.86
5.5.270.0130.07020.87
5.5.260.0030.09020.77
5.5.250.0170.06020.59
5.5.240.0130.07720.08
5.4.450.0700.07019.34
5.4.440.0630.06019.71
5.4.430.0130.05019.36
5.4.420.0170.05019.58
5.4.410.0070.05719.43
5.4.400.0030.07719.25
5.4.390.0130.06319.08
5.4.380.0270.05018.86
5.4.370.0330.05018.53
5.4.360.0300.05018.77
5.4.350.0400.04318.79
5.4.340.0270.05318.63
5.4.320.0050.04112.50
5.4.310.0060.03912.49
5.4.300.0100.04612.50
5.4.290.0060.04312.48
5.4.280.0080.04412.38
5.4.270.0090.04912.38
5.4.260.0090.04312.38
5.4.250.0070.04112.38
5.4.240.0120.05812.38
5.4.230.0090.06012.37
5.4.220.0080.05512.37
5.4.210.0090.05612.37
5.4.200.0100.05812.37
5.4.190.0120.05112.36
5.4.180.0080.05812.36
5.4.170.0120.05612.38
5.4.160.0100.05112.38
5.4.150.0090.05112.37
5.4.140.0110.06912.05
5.4.130.0060.06212.04
5.4.120.0080.05412.00
5.4.110.0130.05212.00
5.4.100.0090.05612.00
5.4.90.0080.06111.99
5.4.80.0150.05811.99
5.4.70.0080.05511.99
5.4.60.0060.06111.99
5.4.50.0080.05711.99
5.4.40.0090.05111.98
5.4.30.0110.06111.98
5.4.20.0130.05011.98
5.4.10.0180.05211.98
5.4.00.0080.04011.47
5.3.290.0080.04312.80
5.3.280.0100.03812.71
5.3.270.0040.04612.72
5.3.260.0090.06012.72
5.3.250.0140.05412.72
5.3.240.0090.06712.72
5.3.230.0110.05412.71
5.3.220.0070.05812.68
5.3.210.0090.05812.68
5.3.200.0080.11212.68
5.3.190.0150.03812.68
5.3.180.0110.05812.68
5.3.170.0090.05812.67
5.3.160.0050.06512.67
5.3.150.0130.05312.67
5.3.140.0210.07412.66
5.3.130.0120.05412.66
5.3.120.0110.04812.66
5.3.110.0190.06112.66
5.3.100.0090.05812.12
5.3.90.0120.06112.11
5.3.80.0080.05612.09
5.3.70.0080.04712.09
5.3.60.0110.04212.08
5.3.50.0110.03912.02
5.3.40.0100.05312.03
5.3.30.0120.06111.98
5.3.20.0170.07511.77
5.3.10.0170.05311.73
5.3.00.0080.05811.72
5.2.170.0100.0439.22
5.2.160.0120.0539.22
5.2.150.0060.0489.22
5.2.140.0080.0459.22
5.2.130.0100.0419.18
5.2.120.0130.0629.18
5.2.110.0190.0839.18
5.2.100.0120.0459.18
5.2.90.0110.0479.18
5.2.80.0180.0689.18
5.2.70.0120.1019.18
5.2.60.0160.0669.14
5.2.50.0150.0619.11
5.2.40.0060.0459.09
5.2.30.0100.0439.05
5.2.20.0060.0409.05
5.2.10.0080.0628.95
5.2.00.0110.0288.81
5.1.60.0080.0378.08
5.1.50.0060.0248.07
5.1.40.0070.0328.06
5.1.30.0160.0508.41
5.1.20.0110.0378.43
5.1.10.0110.0358.16
5.1.00.0270.0338.16
5.0.50.0200.0596.64
5.0.40.0090.0386.50
5.0.30.0200.0586.31
5.0.20.0090.0286.31
5.0.10.0050.0416.28
5.0.00.0050.0456.28
4.4.90.0140.0344.78
4.4.80.0340.0534.75
4.4.70.0060.0454.76
4.4.60.0100.0464.76
4.4.50.0090.0464.77
4.4.40.0150.0854.71
4.4.30.0080.0324.76
4.4.20.0050.0284.84
4.4.10.0080.0214.84
4.4.00.0120.0674.76
4.3.110.0060.0254.67
4.3.100.0050.0214.66
4.3.90.0060.0194.63
4.3.80.0030.0474.58
4.3.70.0110.0214.63
4.3.60.0040.0154.63
4.3.50.0040.0224.63
4.3.40.0260.0944.54
4.3.30.0030.0303.34
4.3.20.0080.0273.31
4.3.10.0130.0313.27
4.3.00.0070.0238.24

preferences:
42.66 ms | 401 KiB | 5 Q