3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array ( array ( 'result_title' => 'Agathoklis Georgiou', 'result_subtext' => 'Active Employee' ), array ( 'result_title' => 'Frixos Georgiou', 'result_subtext' => 'Active Employee' ), array ( 'result_title' => 'George Ellinas', 'result_subtext' => 'Active Employee' ), array ( 'result_title' => 'Fred Ellinas', 'result_subtext' => 'Active Employee' ), array ( 'result_title' => 'Georgi Georgiev', 'result_subtext' => 'Active Employee' ), array ( 'result_title' => 'Charalambos Georgiou', 'result_subtext' => 'Former Employee' ), array ( 'result_title' => 'Georgia Kantouna', 'result_subtext' => 'Former Employee' ) ); $term = 'geo'; usort($data, function ($a, $b) use ($term) { // find the term in first entry $t1 = preg_match("/^.*?\b($term\w+).*\$/i", $a['result_title'], $matches) ? $matches[1] : ''; // find the term in second entry $t2 = preg_match("/^.*?\b($term\w+).*\$/i", $b['result_title'], $matches) ? $matches[1] : ''; // check if the terms were found if ($t1 == '' && $t2 != '') return 1; if ($t1 != '' && $t2 == '') return -1; // found in both - if not the same, just sort on the keyword if ($t1 != $t2) return strcmp($t1, $t2); // found the same keyword, sort on the whole title return strcmp($a['result_title'], $b['result_title']); }); print_r($data);

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.0110.00716.75
8.3.60.0130.00318.55
8.3.50.0100.00718.09
8.3.40.0110.01119.14
8.3.30.0100.00718.84
8.3.20.0000.00818.96
8.3.10.0000.00823.48
8.3.00.0040.00420.84
8.2.190.0170.00316.75
8.2.180.0030.01617.00
8.2.170.0070.00722.96
8.2.160.0100.00322.39
8.2.150.0080.00025.66
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0080.00020.00
8.2.110.0110.00021.12
8.2.100.0090.00317.84
8.2.90.0080.00017.88
8.2.80.0000.00918.05
8.2.70.0030.00617.91
8.2.60.0000.00818.34
8.2.50.0050.00318.10
8.2.40.0050.00219.45
8.2.30.0050.00219.34
8.2.20.0030.00518.22
8.2.10.0030.00618.34
8.2.00.0050.00318.33
8.1.280.0190.00325.92
8.1.270.0090.00022.23
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00321.27
8.1.230.0040.00722.67
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0050.00317.60
8.1.190.0030.00617.66
8.1.180.0040.00418.10
8.1.170.0040.00418.56
8.1.160.0000.00718.95
8.1.150.0000.00818.85
8.1.140.0000.00722.20
8.1.130.0000.00917.60
8.1.120.0040.00417.69
8.1.110.0020.00517.64
8.1.100.0100.00017.69
8.1.90.0000.00817.54
8.1.80.0080.00017.63
8.1.70.0000.00817.63
8.1.60.0030.00617.77
8.1.50.0080.00017.57
8.1.40.0000.00817.77
8.1.30.0030.01117.91
8.1.20.0030.00717.57
8.1.10.0030.00517.75
8.1.00.0030.00617.67
8.0.300.0000.00820.02
8.0.290.0060.00317.00
8.0.280.0040.00418.41
8.0.270.0000.00717.00
8.0.260.0030.00316.90
8.0.250.0030.00717.03
8.0.240.0040.00417.04
8.0.230.0070.00017.13
8.0.220.0000.00717.10
8.0.210.0040.00417.02
8.0.200.0000.00617.14
8.0.190.0040.00417.02
8.0.180.0050.00317.07
8.0.170.0050.00316.91
8.0.160.0000.00817.02
8.0.150.0040.00416.97
8.0.140.0000.00716.98
8.0.130.0060.00013.43
8.0.120.0040.00417.01
8.0.110.0080.00016.93
8.0.100.0000.00717.08
8.0.90.0040.00416.93
8.0.80.0120.00917.04
8.0.70.0020.00516.84
8.0.60.0080.00017.04
8.0.50.0040.00417.13
8.0.30.0130.00817.20
8.0.20.0100.00917.40
8.0.10.0050.00217.05
8.0.00.0140.00316.98
7.4.330.0030.00315.55
7.4.320.0000.00716.75
7.4.300.0060.00016.85
7.4.290.0000.00816.72
7.4.280.0030.00516.73
7.4.270.0000.00716.72
7.4.260.0040.00416.77
7.4.250.0000.00716.80
7.4.240.0070.00016.76
7.4.230.0000.00716.83
7.4.220.0060.00316.65
7.4.210.0070.00916.84
7.4.200.0030.00316.92
7.4.160.0080.00916.72
7.4.140.0090.01017.86
7.4.130.0200.00016.82
7.4.120.0110.00916.67
7.4.110.0110.00716.77
7.4.100.0090.01416.66
7.4.90.0130.00716.71
7.4.80.0100.01319.39
7.4.70.0190.00416.61
7.4.60.0110.00916.61
7.4.50.0130.00516.75
7.4.40.0120.00616.54
7.4.30.0180.00016.55
7.4.20.0110.01216.69
7.4.10.0040.01516.54
7.4.00.0070.01216.21
7.3.330.0000.00613.43
7.3.320.0030.00313.29
7.3.310.0000.00716.61
7.3.300.0030.00316.52
7.3.290.0030.00316.41
7.3.280.0030.01316.49
7.3.260.0130.00916.64
7.3.240.0110.00716.55
7.3.230.0030.01316.71
7.3.210.0030.01316.91
7.3.200.0000.01816.62
7.3.190.0130.00916.58
7.3.180.0100.00816.54
7.3.170.0140.00416.64
7.3.160.0130.00316.71
7.3.150.0200.00016.71
7.3.140.0060.01316.49
7.3.130.0090.01216.80
7.3.120.0120.00616.74
7.3.110.0110.01116.71
7.3.100.0110.00716.78
7.3.90.0120.00616.73
7.3.80.0070.01516.45
7.3.70.0070.01316.45
7.3.60.0210.00316.68
7.3.50.0110.00616.48
7.3.40.0090.00916.55
7.3.30.0100.01016.53
7.3.20.0090.00916.58
7.3.10.0150.00316.80
7.3.00.0130.01016.76
7.2.330.0060.01216.86
7.2.320.0150.00316.82
7.2.310.0130.01017.07
7.2.300.0110.00816.78
7.2.290.0110.00817.02
7.2.280.0130.01016.84
7.2.270.0150.00716.68
7.2.260.0130.00716.78
7.2.250.0120.01216.73
7.2.240.0090.00916.78
7.2.230.0060.01216.71
7.2.220.0090.00916.67
7.2.210.0110.00916.87
7.2.200.0090.01316.90
7.2.190.0070.01716.75
7.2.180.0220.00016.81
7.2.170.0040.01416.79
7.2.160.0070.01016.69
7.2.150.0070.01717.07
7.2.140.0120.00616.95
7.2.130.0130.01016.90
7.2.120.0440.00715.89
7.2.110.0740.01415.94
7.2.100.0660.00515.91
7.2.90.0750.01115.97
7.2.80.0710.00915.97
7.2.70.1000.00515.86
7.2.60.0220.00816.16
7.2.50.0420.00715.99
7.2.40.0310.00816.00
7.2.30.0360.01116.15
7.2.20.0680.00715.83
7.2.10.0230.00415.84
7.2.00.0110.01416.10
7.1.330.0100.00615.97
7.1.320.0070.01115.89
7.1.310.0070.01015.91
7.1.300.0130.00315.60
7.1.290.0160.00615.66
7.1.280.0030.01315.87
7.1.270.0030.01315.69
7.1.260.0090.01015.91
7.1.250.0130.00315.73
7.1.240.0420.01115.01
7.1.230.0350.01214.81
7.1.220.0410.00914.86
7.1.210.0470.00514.83
7.1.200.0790.00815.05
7.1.190.0790.01114.90
7.1.180.0350.01414.73
7.1.170.0230.00914.78
7.1.160.0190.00614.79
7.1.150.0320.00514.69
7.1.140.0760.00814.89
7.1.130.0730.01014.83
7.1.120.0260.00714.97
7.1.110.0120.01214.94
7.1.100.0090.00814.85
7.1.90.0070.01114.83
7.1.80.0160.00414.86
7.1.70.0110.00914.74
7.1.60.0070.01014.75
7.1.50.0690.00814.71
7.1.40.0920.00414.86
7.1.30.0140.00814.86
7.1.20.0120.00414.98
7.1.10.0630.01214.89
7.1.00.0090.01214.82
7.0.330.0060.01215.42
7.0.320.0140.01015.54
7.0.310.0070.01115.26
7.0.300.0090.01215.52
7.0.290.0100.00715.43
7.0.280.0140.01115.45
7.0.270.0060.01315.54
7.0.260.0150.00815.17
7.0.250.0130.00315.32
7.0.240.0080.00915.43
7.0.230.0150.00415.61
7.0.220.0140.00315.41
7.0.210.0070.01415.44
7.0.200.0070.01015.56
7.0.190.0060.01215.36
7.0.180.0040.01515.54
7.0.170.0170.00315.51
7.0.160.0070.01115.48
7.0.150.0060.01115.43
7.0.140.0060.01415.51
7.0.130.0150.00715.52
7.0.120.0140.00615.41
7.0.110.0100.01015.51
7.0.100.0070.01015.45
7.0.90.0130.00515.40
7.0.80.0140.00715.40
7.0.70.0150.01215.64
7.0.60.0070.01115.47
7.0.50.0130.00315.55
7.0.40.0110.00715.43
7.0.30.0180.00615.43
7.0.20.0070.01015.43
7.0.10.0120.00615.46
7.0.00.0090.01315.61
5.6.400.0130.01016.16
5.6.390.0110.01116.29
5.6.380.0130.00915.29
5.6.370.0170.01016.31
5.6.360.0000.02016.04
5.6.350.0060.01616.12
5.6.340.0080.01215.91
5.6.330.0100.01015.80
5.6.320.0090.01015.79
5.6.310.0140.00515.96
5.6.300.0140.01015.95
5.6.290.0130.01016.23
5.6.280.0130.01315.95
5.6.270.0140.00816.27
5.6.260.0130.00716.25
5.6.250.0060.01216.09
5.6.240.0130.00716.04
5.6.230.0190.00916.02
5.6.220.0090.00916.07
5.6.210.0150.00616.05
5.6.200.0100.01016.04
5.6.190.0070.01816.01
5.6.180.0070.01815.86
5.6.170.0110.01416.11
5.6.160.0140.01115.99
5.6.150.0170.00716.05
5.6.140.0060.01215.96
5.6.130.0130.00616.14
5.6.120.0030.01716.13
5.6.110.0110.00816.16
5.6.100.0030.01616.08
5.6.90.0090.00916.00
5.6.80.0140.00715.88
5.6.70.0100.01015.90
5.6.60.0120.00615.97
5.6.50.0130.00716.05
5.6.40.0100.01615.84
5.6.30.0160.01015.89
5.6.20.0120.01315.87
5.6.10.0160.01016.05
5.6.00.0100.01716.00

preferences:
50.06 ms | 401 KiB | 5 Q