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"; function sort_most_needles(&$array, $str) { $needles = explode(" ", $str); usort($array, fn($a, $b) => array_uintersect($needles, explode(" ", $b['title']), 'strcasecmp') <=> array_uintersect($needles, explode(" ", $a['title']), 'strcasecmp') ); } sort_most_needles($arr, $str); var_export($arr);

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.5.00.0120.01019.68
8.4.150.0030.00014.05
8.4.140.0130.00917.59
8.4.130.0140.00718.07
8.4.120.0080.01220.79
8.4.110.0140.00620.59
8.4.100.0100.01117.82
8.4.90.0180.00417.88
8.4.80.0090.00919.50
8.4.70.0150.00517.91
8.4.60.0090.01118.83
8.4.50.0110.00917.90
8.4.40.0160.00619.64
8.4.30.0130.00620.53
8.4.20.0100.00018.92
8.4.10.0090.00017.80
8.3.280.0020.00014.05
8.3.270.0120.00916.77
8.3.260.0140.00416.88
8.3.250.0140.00518.96
8.3.240.0060.00316.78
8.3.230.0130.00716.66
8.3.220.0070.01116.61
8.3.210.0110.00916.82
8.3.200.0040.00516.79
8.3.190.0100.00916.82
8.3.180.0110.00716.62
8.3.170.0130.00616.47
8.3.160.0080.01118.23
8.3.150.0150.00317.15
8.3.140.0120.00619.18
8.3.130.0100.01018.50
8.3.120.0190.00020.53
8.3.110.0030.00616.61
8.3.100.0030.00716.53
8.3.90.0070.00726.77
8.3.80.0070.00316.63
8.3.70.0090.00618.63
8.3.60.0140.00418.27
8.3.50.0140.00521.94
8.3.40.0120.00318.83
8.3.30.0110.00318.79
8.3.20.0030.00622.11
8.3.10.0040.00422.00
8.3.00.0030.00523.52
8.2.290.0080.00818.97
8.2.280.0050.00518.58
8.2.270.0040.01517.27
8.2.260.0070.01119.05
8.2.250.0080.00017.05
8.2.240.0110.00319.07
8.2.230.0070.00320.94
8.2.220.0060.00324.06
8.2.210.0120.00326.77
8.2.200.0040.00816.50
8.2.190.0180.00316.88
8.2.180.0040.01118.16
8.2.170.0110.00422.96
8.2.160.0070.01122.10
8.2.150.0030.00624.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0040.00419.36
8.2.110.0030.00622.03
8.2.100.0090.00317.78
8.2.90.0000.00817.88
8.2.80.0080.00019.77
8.2.70.0040.00418.05
8.2.60.0040.00418.16
8.2.50.0030.00518.10
8.2.40.0030.00619.30
8.2.30.0000.00719.27
8.2.20.0040.00418.14
8.2.10.0040.00419.32
8.2.00.0040.00419.20
8.1.330.0080.01116.38
8.1.320.0070.00816.17
8.1.310.0030.00616.75
8.1.300.0000.00820.04
8.1.290.0060.00330.84
8.1.280.0150.00325.92
8.1.270.0030.00622.13
8.1.260.0000.00926.35
8.1.250.0080.00028.09
8.1.240.0000.00919.13
8.1.230.0120.00020.88
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.01017.47
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0080.00018.50
8.1.160.0000.00818.82
8.1.150.0050.00218.97
8.1.140.0060.00320.84
8.1.130.0030.00320.16
8.1.120.0070.00017.53
8.1.110.0050.00217.47
8.1.100.0040.00417.45
8.1.90.0000.00917.49
8.1.80.0050.00317.49
8.1.70.0000.00717.53
8.1.60.0000.00817.55
8.1.50.0040.00417.50
8.1.40.0000.00817.56
8.1.30.0040.00417.74
8.1.20.0050.00317.66
8.1.10.0000.00817.62
8.1.00.0040.00817.45
8.0.300.0000.00819.68
8.0.290.0000.00816.75
8.0.280.0000.00818.47
8.0.270.0050.00316.91
8.0.260.0070.00021.73
8.0.250.0030.00617.00
8.0.240.0000.00616.97
8.0.230.0000.00817.05
8.0.220.0030.00516.85
8.0.210.0000.00716.87
8.0.200.0040.00417.00
8.0.190.0000.00716.89
8.0.180.0000.00816.82
8.0.170.0060.00316.96
8.0.160.0000.00716.88
8.0.150.0000.00716.81
8.0.140.0040.00416.85
8.0.130.0060.00013.30
8.0.120.0030.00616.92
8.0.110.0000.00816.93
8.0.100.0000.00816.92
8.0.90.0040.00416.78
8.0.80.0000.01516.84
8.0.70.0000.00716.78
8.0.60.0040.00416.88
8.0.50.0030.00516.70
8.0.30.0160.00017.15
8.0.20.0070.01217.24
8.0.10.0040.00416.98
8.0.00.0070.01016.71
7.4.330.0020.00215.55
7.4.320.0030.00316.59
7.4.300.0000.00716.61
7.4.290.0000.00716.62
7.4.280.0040.00416.51
7.4.270.0030.00316.63
7.4.260.0030.00313.36
7.4.250.0000.00816.49
7.4.240.0060.00116.61
7.4.230.0000.00716.59
7.4.220.0040.00416.52
7.4.210.0070.00816.68
7.4.200.0040.00416.69
7.4.130.0080.01616.45
7.4.120.0180.00716.40
7.4.110.0030.01416.50
7.4.100.0160.00616.55
7.4.90.0070.01116.60
7.4.80.0100.00719.39
7.4.70.0060.01016.46
7.4.60.0060.01016.58
7.4.50.0100.00316.17
7.4.40.0130.01016.51
7.3.330.0070.00016.03
7.3.320.0030.00313.30
7.3.310.0030.00516.24
7.3.300.0000.00716.05
7.3.290.0060.00016.21
7.3.280.0080.00916.18
7.3.260.0120.00816.24
7.3.230.0110.00716.32
7.3.210.0060.01516.26
7.3.200.0070.01016.36
7.3.190.0120.00616.26
7.3.180.0130.00716.42
7.3.170.0070.01416.24
7.3.160.0190.00016.22
7.3.80.0060.00614.63
7.3.70.0030.00914.50
7.3.60.0060.00614.34
7.3.50.0060.00614.49
7.3.40.0040.00714.33
7.3.30.0070.00414.41
7.3.20.0100.00714.07
7.3.10.0070.01014.28
7.3.00.0100.01014.61
7.2.330.0090.00916.19
7.2.320.0090.00916.50
7.2.310.0060.01016.49
7.2.300.0030.01316.41
7.2.290.0100.00716.48
7.2.210.0080.00814.59
7.2.200.0120.00314.43
7.2.190.0060.00614.39
7.2.180.0090.00314.52
7.2.170.0040.00814.29
7.2.160.0080.00414.50
7.2.150.0160.00314.39
7.2.140.0110.00814.51
7.2.130.0070.01114.36
7.2.120.0110.00714.67
7.2.110.0120.00614.78
7.2.100.0100.01014.40
7.2.90.0100.00714.61
7.2.80.0140.00714.84
7.2.70.0120.00814.91
7.2.60.0070.01114.73
7.2.50.0150.00414.69
7.2.40.0160.00314.84
7.2.30.0120.00614.93
7.2.20.0140.00514.71
7.2.10.0110.00714.46
7.2.00.0130.00614.67
7.1.310.0190.00313.73
7.1.300.0160.00713.06
7.1.290.0070.01013.40
7.1.280.0150.00413.62
7.1.270.0140.00713.52
7.1.260.0160.00313.41
7.1.250.0040.01213.36

preferences:
178.32 ms | 403 KiB | 5 Q