3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(array("id" => 1,"title" => "Hello world", "body" => "Hi Jude All this is my content"), array("id" => 2,"title" => "Hello world Boy", "body" => "Hi All this is my content Girl"), array("id" => 3,"title" => "hello Kids", "body" => "Hi All this is my content Kid"), array("id" => 4,"title" => "Hello World Jude", "body" => "Hi All this is my content Jude"), array("id" => 5,"title" => "Hello World Jude January", "body" => "Hi All this is my content Jan"), array("id" => 6,"title" => "Hello World January June Lord", "body" => "Hi All this is my content Jan Jude Lord")); $str = "hello world january jude"; $arr2 = sort_most_exists_asc($arr, $str); var_dump($arr2); function sort_most_exists_asc($array, $str) { usort($array, function ($a, $b) use ($str) { $aa = count(array_uintersect(explode(" ", $str), explode(" ", $a['title']), 'strcasecmp')); $bb = count(array_uintersect(explode(" ", $str), explode(" ", $b['title']), 'strcasecmp')); return $bb - $aa; }); return $array; }

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.4.140.0120.01017.95
8.4.130.0130.00717.87
8.4.120.0100.00924.20
8.4.110.0100.00822.39
8.4.100.0070.00317.86
8.4.90.0130.00720.73
8.4.80.0100.00717.89
8.4.70.0110.01119.80
8.4.60.0160.00518.57
8.4.50.0110.01019.47
8.4.40.0090.01022.46
8.4.30.0190.00317.61
8.4.20.0070.01420.68
8.4.10.0030.00717.75
8.3.270.0100.01016.66
8.3.260.0110.00916.57
8.3.250.0110.00818.79
8.3.240.0120.00716.54
8.3.230.0080.01116.38
8.3.220.0060.00420.64
8.3.210.0120.00816.52
8.3.200.0060.00316.63
8.3.190.0130.00816.44
8.3.180.0050.00316.43
8.3.170.0090.00016.83
8.3.160.0060.01316.75
8.3.150.0040.01517.16
8.3.140.0100.00717.15
8.3.130.0100.01018.27
8.3.120.0030.00618.73
8.3.110.0030.00620.94
8.3.100.0070.00324.06
8.3.90.0150.00318.45
8.3.80.0000.00918.68
8.3.70.0110.00416.50
8.3.60.0040.01818.43
8.3.50.0110.00318.31
8.3.40.0170.00318.84
8.3.30.0040.01218.79
8.3.20.0040.00420.72
8.3.10.0080.00023.56
8.3.00.0040.00421.89
8.2.290.0110.00917.32
8.2.280.0040.00518.48
8.2.270.0120.00616.64
8.2.260.0040.01516.37
8.2.250.0080.00018.68
8.2.240.0040.00418.98
8.2.230.0080.00022.58
8.2.220.0100.00737.54
8.2.210.0000.00826.77
8.2.200.0060.00316.46
8.2.190.0110.00416.88
8.2.180.0130.01017.00
8.2.170.0090.00622.96
8.2.160.0120.00321.14
8.2.150.0040.00424.18
8.2.140.0090.00624.66
8.2.130.0070.00026.16
8.2.120.0030.00719.21
8.2.110.0090.00020.92
8.2.100.0060.00617.91
8.2.90.0090.00020.48
8.2.80.0050.00318.05
8.2.70.0040.00418.05
8.2.60.0040.00418.14
8.2.50.0030.00518.10
8.2.40.0050.00319.53
8.2.30.0000.00720.75
8.2.20.0040.00418.15
8.2.10.0030.00619.45
8.2.00.0000.00818.02
8.1.330.0080.01116.81
8.1.320.0120.00816.50
8.1.310.0200.00015.99
8.1.300.0120.00318.18
8.1.290.0030.00618.88
8.1.280.0110.01125.92
8.1.270.0040.00422.05
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0080.00020.96
8.1.230.0060.00620.70
8.1.220.0040.00417.74
8.1.210.0000.00818.96
8.1.200.0030.00517.36
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0000.00818.53
8.1.160.0040.00418.91
8.1.150.0040.00418.79
8.1.140.0000.00719.02
8.1.130.0000.00720.19
8.1.120.0040.00417.38
8.1.110.0030.00517.47
8.1.100.0070.00317.30
8.1.90.0080.00017.48
8.1.80.0080.00017.48
8.1.70.0000.00817.38
8.1.60.0000.00817.63
8.1.50.0030.00517.53
8.1.40.0090.00017.55
8.1.30.0040.00417.63
8.1.20.0060.00317.59
8.1.10.0050.00317.50
8.1.00.0040.00417.46
8.0.300.0000.00820.02
8.0.290.0050.00316.75
8.0.280.0000.00718.48
8.0.270.0000.00717.15
8.0.260.0030.00618.38
8.0.250.0030.00317.02
8.0.240.0070.00017.04
8.0.230.0000.00716.97
8.0.220.0000.00917.00
8.0.210.0030.00316.91
8.0.200.0000.00716.84
8.0.190.0040.00416.89
8.0.180.0000.00716.96
8.0.170.0030.00516.76
8.0.160.0040.00416.94
8.0.150.0030.00616.94
8.0.140.0040.00416.88
8.0.130.0000.00613.30
8.0.120.0030.00616.88
8.0.110.0040.00416.88
8.0.100.0000.00916.73
8.0.90.0000.00716.91
8.0.80.0060.01016.89
8.0.70.0000.00716.94
8.0.60.0040.00416.91
8.0.50.0040.00416.94
8.0.30.0080.01117.06
8.0.20.0110.00917.01
8.0.10.0050.00316.95
8.0.00.0120.00916.93
7.4.330.0050.00016.70
7.4.320.0060.00016.42
7.4.300.0040.00416.53
7.4.290.0070.00016.42
7.4.280.0080.00016.52
7.4.270.0070.00016.67
7.4.260.0050.00216.48
7.4.250.0000.00716.48
7.4.240.0050.00316.63
7.4.230.0000.00916.61
7.4.220.0000.00816.60
7.4.210.0090.00716.50
7.4.200.0030.00316.38
7.4.160.0120.00716.47
7.4.140.0140.00717.86
7.4.130.0110.01116.50
7.4.120.0120.00816.59
7.4.110.0090.01216.37
7.4.100.0160.00616.37
7.4.90.0130.00616.38
7.4.80.0120.00619.39
7.4.70.0140.00416.60
7.4.60.0150.00916.40
7.4.50.0000.01016.38
7.4.40.0130.00616.28
7.4.00.0100.00715.08
7.3.330.0000.00613.25
7.3.320.0030.00313.41
7.3.310.0050.00316.49
7.3.300.0000.00716.26
7.3.290.0030.00316.18
7.3.280.0090.00616.33
7.3.260.0110.01016.51
7.3.240.0130.00716.35
7.3.230.0090.00916.64
7.3.210.0100.00716.50
7.3.200.0140.00916.62
7.3.190.0070.01016.35
7.3.180.0090.01516.54
7.3.170.0100.01316.50
7.3.160.0030.01316.48
7.3.40.0110.00414.84
7.3.30.0080.00414.84
7.3.20.0150.01214.68
7.3.10.0950.00315.04
7.3.00.0100.00314.84
7.2.330.0110.00916.71
7.2.320.0090.00916.70
7.2.310.0150.00316.52
7.2.300.0120.00616.82
7.2.290.0070.01216.75
7.2.170.0130.00915.00
7.2.160.0170.00714.99
7.2.150.0070.01415.12
7.2.140.0180.00614.92
7.2.130.0040.01315.16
7.2.120.0130.00615.23
7.2.110.0090.01515.13
7.2.100.0150.00015.02
7.2.90.0100.00315.16
7.2.80.0180.00915.17
7.2.70.0040.01315.22
7.2.60.0050.00814.97
7.2.50.0000.01315.15
7.2.40.0070.00715.07
7.2.30.0190.00615.12
7.2.20.0160.01615.04
7.2.10.0140.00315.12
7.2.00.0080.01415.06
7.1.280.0050.01113.91
7.1.270.0110.01113.95
7.1.260.0090.00413.93
7.1.250.0110.00313.78

preferences:
40.63 ms | 403 KiB | 5 Q