3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 0 => 'ARRELEMENT_test', 1 => 'ARRELEMENT_test_v8', 2 => 'ARRELEMENT_test_v9', 3 => 'ARRELEMENT_test_v1', 4 => 'ARRELEMENT_test_v2', 5 => 'ARRELEMENT_test_v3' ); function getMaxTest($arr){ foreach($arr as $key=>$val){ preg_match('!\d+!', $val, $match); if($match){ $index[$key]= $match[0]; } } arsort($index); reset($index); $first_key = key($index); //var_dump($first_key); return $first_key; } $maxIndex = getMaxTest($arr); echo $arr[$maxIndex]; //die; //natsort($arr); //print_r(end($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.30.0080.00919.16
8.5.20.0090.01019.46
8.5.10.0120.00716.79
8.5.00.0130.00920.07
8.4.180.0120.01320.00
8.4.170.0110.01024.05
8.4.160.0100.01223.28
8.4.150.0070.00616.96
8.4.140.0130.01018.09
8.4.130.0110.00917.96
8.4.120.0030.00520.58
8.4.110.0060.00318.89
8.4.100.0120.00818.22
8.4.90.0120.00820.59
8.4.80.0120.00718.78
8.4.70.0050.00319.06
8.4.60.0120.00918.97
8.4.50.0170.00518.86
8.4.40.0160.00317.78
8.4.30.0080.00018.04
8.4.20.0100.01019.60
8.4.10.0050.00520.68
8.3.300.0120.00820.80
8.3.290.0110.01020.88
8.3.280.0100.01018.58
8.3.270.0160.00416.55
8.3.260.0100.00916.80
8.3.250.0120.00718.61
8.3.240.0110.01016.98
8.3.230.0090.00816.88
8.3.220.0110.00519.04
8.3.210.0130.00816.72
8.3.200.0040.00416.86
8.3.190.0120.00517.05
8.3.180.0050.00318.96
8.3.170.0110.00719.16
8.3.160.0100.00919.02
8.3.150.0060.01217.10
8.3.140.0040.00420.56
8.3.130.0060.00918.42
8.3.120.0070.00418.86
8.3.110.0090.00020.94
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0000.00917.97
8.3.70.0060.00916.50
8.3.60.0030.01218.48
8.3.50.0040.00918.32
8.3.40.0140.00419.00
8.3.30.0130.00618.92
8.3.20.0040.00419.15
8.3.10.0050.00321.79
8.3.00.0050.00222.52
8.2.300.0130.00820.29
8.2.290.0070.01216.79
8.2.280.0080.01118.41
8.2.270.0120.00318.46
8.2.260.0050.00317.25
8.2.250.0060.01218.46
8.2.240.0040.00420.86
8.2.230.0060.01322.58
8.2.220.0090.00037.54
8.2.210.0030.00526.77
8.2.200.0030.00616.75
8.2.190.0120.00616.88
8.2.180.0140.00716.75
8.2.170.0120.00319.04
8.2.160.0130.00722.96
8.2.150.0000.00825.66
8.2.140.0050.00324.66
8.2.130.0020.00521.00
8.2.120.0070.00026.35
8.2.110.0070.00319.30
8.2.100.0090.00318.09
8.2.90.0040.00418.09
8.2.80.0040.00418.16
8.2.70.0040.00418.05
8.2.60.0050.00318.16
8.2.50.0030.00618.10
8.2.40.0070.00019.33
8.2.30.0050.00221.29
8.2.20.0050.00318.08
8.2.10.0000.00718.14
8.2.00.0070.00019.33
8.1.340.0130.00717.86
8.1.330.0120.00716.74
8.1.320.0120.00317.66
8.1.310.0120.00618.70
8.1.300.0030.00619.76
8.1.290.0030.00630.84
8.1.280.0090.00625.92
8.1.270.0000.00723.83
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.01322.07
8.1.230.0040.00817.83
8.1.220.0090.00017.78
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0040.00417.48
8.1.180.0040.00418.10
8.1.170.0050.00318.69
8.1.160.0020.00518.91
8.1.150.0000.01020.79
8.1.140.0040.00417.79
8.1.130.0000.00717.60
8.1.120.0030.00417.63
8.1.110.0050.00217.53
8.1.100.0080.00417.53
8.1.90.0000.00817.60
8.1.80.0040.00417.64
8.1.70.0040.00417.49
8.1.60.0040.00417.61
8.1.50.0040.00417.54
8.1.40.0080.00017.63
8.1.30.0050.00317.76
8.1.20.0030.00517.73
8.1.10.0040.00417.73
8.1.00.0090.00017.57
8.0.300.0040.00418.77
8.0.290.0070.00316.88
8.0.280.0000.00718.46
8.0.270.0030.00516.95
8.0.260.0070.00016.97
8.0.250.0030.00316.96
8.0.240.0000.00817.11
8.0.230.0050.00316.97
8.0.220.0070.00016.97
8.0.210.0040.00417.07
8.0.200.0000.00617.13
8.0.190.0040.00417.01
8.0.180.0050.00217.06
8.0.170.0060.00317.05
8.0.160.0000.00817.00
8.0.150.0050.00216.93
8.0.140.0040.00416.99
8.0.130.0030.00513.39
8.0.120.0040.00416.90
8.0.110.0040.00417.04
8.0.100.0030.00517.06
8.0.90.0070.00017.01
8.0.80.0000.01417.04
8.0.70.0000.00717.05
8.0.60.0040.00416.93
8.0.50.0040.00417.04
8.0.30.0070.01017.18
8.0.20.0160.00317.40
8.0.10.0070.00017.20
8.0.00.0110.00716.93
7.4.330.0020.00215.55
7.4.320.0050.00316.80
7.4.300.0030.00316.63
7.4.290.0070.00016.66
7.4.280.0000.00916.60
7.4.270.0030.00316.77
7.4.260.0080.00016.76
7.4.250.0000.00816.69
7.4.240.0040.00416.61
7.4.230.0050.00316.61
7.4.220.0000.00716.84
7.4.210.0100.00816.83
7.4.200.0030.00316.66
7.4.140.0120.00817.86
7.4.130.0180.00016.55
7.4.120.0120.00716.72
7.4.110.0070.01016.82
7.4.100.0110.00716.62
7.4.90.0090.00916.70
7.4.80.0090.01119.39
7.4.70.0170.00516.66
7.4.60.0100.00716.80
7.4.50.0090.00616.80
7.4.40.0120.00816.82
7.4.00.0090.00415.26
7.3.330.0020.00213.52
7.3.320.0030.00313.35
7.3.310.0070.00016.52
7.3.300.0030.00316.54
7.3.290.0000.00716.41
7.3.280.0100.00716.48
7.3.260.0120.00516.57
7.3.240.0100.00916.75
7.3.230.0070.01316.55
7.3.210.0080.00816.84
7.3.200.0080.01616.52
7.3.190.0070.01016.74
7.3.180.0130.00616.92
7.3.170.0110.00616.89
7.3.160.0060.01016.81
7.2.330.0090.00916.63
7.2.320.0090.01216.71
7.2.310.0100.01016.71
7.2.300.0120.00416.85
7.2.290.0070.01116.64
7.2.60.0030.00617.32
7.2.50.0190.00416.98
7.2.40.1130.01018.16
7.2.30.2050.01218.44
7.2.20.1690.01318.26
7.2.10.2190.01518.50
7.2.00.1460.01018.36
7.1.200.0030.01015.91
7.1.160.2100.00917.29
7.1.150.1490.00917.18
7.1.140.1740.01017.07
7.1.130.1820.01416.79
7.1.120.1510.00717.16
7.1.110.2430.01016.44
7.1.100.1430.00816.73
7.1.90.1260.01216.55
7.1.80.1850.00716.82
7.1.70.1070.01115.73
7.1.60.1640.01233.70
7.1.50.1530.01233.12
7.1.40.1700.01032.82
7.1.30.1290.01233.01
7.1.20.1590.01332.77
7.1.10.1020.00615.02
7.1.00.0990.01215.17

preferences:
120.45 ms | 1401 KiB | 5 Q