3v4l.org

run code in 300+ PHP versions simultaneously
<?php $res = strnatcmp(122,200); echo $res; $abc = array( 'rec_1' => array('fn'=>'Aron','ln'=>'Michaelson'), 'rec_2' => array('fn'=>'Abbey','ln'=>'Drake'), 'rec_3' => array('fn'=>'Alice','ln'=>'Peterson')); function build_sorter($key) { return function ($a, $b) use ($key) { return strnatcmp($a[$key], $b[$key]); }; } usort($abc, build_sorter('ln')); /*function SortByLname($a,$b) { return strcmp( $a['ln'], $b['ln'] ); } usort($abc, "SortByLname"); */ foreach ($abc as $item) { echo strtoupper($item['ln']) . ', ' . $item['fn'] . "\n"; }

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.60.0090.01218.30
8.3.50.0100.00922.84
8.3.40.0070.00718.70
8.3.30.0060.01218.85
8.3.20.0040.00420.33
8.3.10.0040.00421.85
8.3.00.0080.00019.66
8.2.180.0030.01218.06
8.2.170.0100.00522.96
8.2.160.0100.00320.39
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0110.00017.63
8.2.110.0090.00020.22
8.2.100.0060.00617.91
8.2.90.0040.00419.36
8.2.80.0070.00019.33
8.2.70.0040.00417.61
8.2.60.0030.00617.93
8.2.50.0060.00318.07
8.2.40.0000.00818.07
8.2.30.0040.00419.41
8.2.20.0000.00817.73
8.2.10.0000.00718.01
8.2.00.0000.00817.63
8.1.280.0140.00025.92
8.1.270.0040.00422.09
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.42
8.1.230.0030.00721.04
8.1.220.0030.00518.77
8.1.210.0040.00418.85
8.1.200.0060.00617.35
8.1.190.0080.00017.40
8.1.180.0050.00318.10
8.1.170.0040.00418.56
8.1.160.0000.01118.89
8.1.150.0040.00418.94
8.1.140.0080.00017.52
8.1.130.0040.00417.82
8.1.120.0040.00417.37
8.1.110.0060.00317.46
8.1.100.0070.00017.50
8.1.90.0040.00417.47
8.1.80.0000.00717.47
8.1.70.0030.00517.47
8.1.60.0030.00617.59
8.1.50.0040.00417.55
8.1.40.0080.00017.52
8.1.30.0060.00317.65
8.1.20.0030.00517.64
8.1.10.0000.00817.54
8.1.00.0000.00717.49
8.0.300.0000.00719.85
8.0.290.0030.00517.16
8.0.280.0000.00718.33
8.0.270.0070.00017.30
8.0.260.0000.00817.19
8.0.250.0030.00316.89
8.0.240.0030.00316.96
8.0.230.0070.00016.94
8.0.220.0050.00316.81
8.0.210.0030.00516.90
8.0.200.0060.00016.96
8.0.190.0000.00717.01
8.0.180.0040.00416.90
8.0.170.0040.00416.84
8.0.160.0030.00516.82
8.0.150.0030.00516.79
8.0.140.0040.00416.85
8.0.130.0060.00013.34
8.0.120.0040.00416.77
8.0.110.0040.00416.75
8.0.100.0040.00417.02
8.0.90.0040.00416.90
8.0.80.0120.00916.89
8.0.70.0000.00816.70
8.0.60.0000.00716.78
8.0.50.0040.00416.94
8.0.30.0090.01017.22
8.0.20.0100.00917.40
8.0.10.0000.00717.08
8.0.00.0060.01116.76
7.4.330.0050.00015.07
7.4.320.0000.00616.64
7.4.300.0040.00416.61
7.4.290.0070.00016.42
7.4.280.0040.00316.41
7.4.270.0000.00716.56
7.4.260.0070.00016.57
7.4.250.0030.00516.40
7.4.240.0020.00616.58
7.4.230.0000.00716.59
7.4.220.0030.01416.52
7.4.210.0030.01316.47
7.4.200.0040.00416.68
7.4.160.0090.00916.55
7.4.150.0100.00717.40
7.4.140.0100.01017.86
7.4.130.0090.01116.58
7.4.120.0060.01216.56
7.4.110.0120.00616.49
7.4.100.0170.00316.41
7.4.90.0100.01016.48
7.4.80.0060.01019.39
7.4.70.0030.01316.52
7.4.60.0060.01516.51
7.4.50.0030.00316.55
7.4.40.0150.00316.65
7.4.30.0000.02116.35
7.4.00.0080.01014.96
7.3.330.0040.00413.38
7.3.320.0030.00313.32
7.3.310.0070.00016.22
7.3.300.0040.00316.37
7.3.290.0100.00716.25
7.3.280.0050.01416.29
7.3.270.0150.00917.40
7.3.260.0150.00316.55
7.3.250.0120.00616.34
7.3.240.0130.00616.67
7.3.230.0040.01216.39
7.3.210.0080.00916.36
7.3.200.0100.01319.39
7.3.190.0100.00616.64
7.3.180.0070.01016.52
7.3.170.0060.01016.63
7.3.160.0100.00616.45
7.3.120.0030.01414.81
7.3.110.0080.00914.72
7.3.100.0090.00814.78
7.3.90.0060.00314.88
7.3.80.0050.01115.00
7.3.70.0020.01214.79
7.3.60.0090.00414.74
7.3.50.0090.00314.63
7.3.40.0080.00614.67
7.3.30.0070.00814.87
7.3.20.0030.01016.69
7.3.10.0070.00716.70
7.3.00.0080.00316.52
7.2.330.0120.00616.70
7.2.320.0060.01116.78
7.2.310.0070.01016.76
7.2.300.0120.00616.57
7.2.290.0130.00916.47
7.2.250.0080.01215.31
7.2.240.0100.01015.03
7.2.230.0080.00814.94
7.2.220.0040.01414.98
7.2.210.0030.00815.11
7.2.200.0000.01415.18
7.2.190.0100.00215.11
7.2.180.0060.00914.94
7.2.170.0060.00815.16
7.2.00.0060.00919.38
7.1.330.0090.00715.67
7.1.320.0070.00515.90
7.1.310.0040.01215.88
7.1.300.0070.00515.72
7.1.290.0060.00715.86
7.1.280.0070.00815.84
7.1.270.0060.00915.95
7.1.260.0000.01215.74
7.1.100.0070.00318.04
7.1.70.0080.00016.93
7.1.60.0110.01419.34
7.1.50.0060.01616.75
7.1.00.0000.08022.45
7.0.200.0050.00216.79
7.0.140.0100.06322.08
7.0.60.0070.06019.84
7.0.50.0100.03317.96
7.0.40.0030.07020.11
7.0.30.0200.08320.08
7.0.20.0330.04720.16
7.0.10.0100.08020.33
7.0.00.0070.07020.25
5.6.280.0100.06720.90
5.6.210.0130.07020.54
5.6.200.0100.03318.22
5.6.190.0130.06720.34
5.6.180.0270.04020.42
5.6.170.0300.07020.54
5.6.160.0170.07720.59
5.6.150.0030.04018.15
5.6.140.0100.07718.12
5.6.130.0070.06718.20
5.6.120.0100.07020.88
5.6.110.0070.08321.02
5.6.100.0030.04020.99
5.6.90.0100.04720.98
5.6.80.0030.07020.40
5.5.350.0070.07720.34
5.5.340.0030.08717.98
5.5.330.0070.08020.25
5.5.320.3930.04720.30
5.5.310.0370.06720.25
5.5.300.0030.04017.92
5.5.290.0100.06717.97
5.5.280.0000.04320.66
5.5.270.0000.09320.64
5.5.260.0170.06720.77
5.5.250.0130.03720.59
5.5.240.0070.07320.30
5.4.450.0270.07719.43
5.4.440.0530.04319.55
5.4.430.0230.04719.30
5.4.420.0300.06319.30
5.4.410.0200.07719.42
5.4.400.0200.07319.09
5.4.390.0170.03719.16
5.4.380.0170.03719.06
5.4.370.0170.03719.18
5.4.360.0170.04019.13
5.4.350.0130.04719.00
5.4.340.0230.04019.20
5.4.320.0130.04019.15
5.4.310.0170.03718.86
5.4.300.0130.04019.14
5.4.290.0230.03319.09
5.4.280.0270.04019.19
5.4.270.0100.04319.08
5.4.260.0130.03719.08
5.4.250.0200.03019.21
5.4.240.0100.04019.20
5.4.230.0200.04019.07
5.4.220.0200.04718.84
5.4.210.0170.03319.06
5.4.200.0130.03719.24
5.4.190.0170.03319.21
5.4.180.0130.03718.84
5.4.170.0130.04318.86
5.4.160.0170.03319.06
5.4.150.0100.04019.20
5.4.140.0230.04316.57
5.4.130.0200.04316.55
5.4.120.0170.03716.46
5.4.110.0200.03316.64
5.4.100.0270.07016.41
5.4.90.0230.06316.32
5.4.80.0270.06716.60
5.4.70.0200.07016.60
5.4.60.0270.04316.43
5.4.50.0300.06316.51
5.4.40.0330.06016.42
5.4.30.0170.04016.37
5.4.20.0230.04316.53
5.4.10.0200.03716.50
5.4.00.0130.04715.80
5.3.290.0170.03714.58
5.3.280.0130.04314.57
5.3.270.0270.02714.61
5.3.260.0100.04014.61
5.3.250.0170.04714.66
5.3.240.0130.05014.69
5.3.230.0170.06314.60
5.3.220.0130.04014.57
5.3.210.0230.06714.64
5.3.200.0200.04314.56
5.3.190.0170.04014.65
5.3.180.0170.03714.47
5.3.170.0270.07014.58
5.3.160.0270.07014.64
5.3.150.0230.04014.64
5.3.140.0270.04314.54
5.3.130.0100.04714.62
5.3.120.0170.04014.71
5.3.110.0330.05714.48
5.3.100.0200.05014.12
5.3.90.0230.03314.11
5.3.80.0270.07013.93
5.3.70.0270.07013.95
5.3.60.0300.04314.01
5.3.50.0230.03013.87
5.3.40.0230.07313.93
5.3.30.0400.03314.13
5.3.20.0230.04313.62
5.3.10.0270.04713.70
5.3.00.0300.05013.62
5.2.170.0170.04013.09
5.2.160.0200.05313.09
5.2.150.0200.05713.09
5.2.140.0170.03313.09
5.2.130.0170.05313.09
5.2.120.0170.05313.09
5.2.110.0270.03013.09
5.2.100.0230.02713.09
5.2.90.0100.03713.09
5.2.80.0170.05013.09
5.2.70.0130.06713.09
5.2.60.0200.05713.09
5.2.50.0200.04013.09
5.2.40.0200.05313.09
5.2.30.0200.03713.09
5.2.20.0200.03313.09
5.2.10.0200.05313.09
5.2.00.0170.06013.09
5.1.60.0130.03713.09
5.1.50.0170.04313.09
5.1.40.0100.05713.09
5.1.30.0170.04013.09
5.1.20.0130.04313.09
5.1.10.0170.05313.09
5.1.00.0170.03713.09
5.0.50.0070.04713.09
5.0.40.0100.03313.09
5.0.30.0070.05313.09
5.0.20.0070.04013.09
5.0.10.0100.02713.09
5.0.00.0030.04313.09
4.4.90.0100.03013.09
4.4.80.0070.02013.09
4.4.70.0100.01713.09
4.4.60.0130.03013.09
4.4.50.0130.02713.09
4.4.40.0130.04313.09
4.4.30.0130.03313.09
4.4.20.0100.03313.09
4.4.10.0070.04013.09
4.4.00.0070.04013.09
4.3.110.0070.03713.09
4.3.100.0070.03013.09
4.3.90.0070.02313.09
4.3.80.0070.03013.09
4.3.70.0070.01313.09
4.3.60.0130.01313.09
4.3.50.0100.01713.09
4.3.40.0100.02713.09
4.3.30.0030.03713.09
4.3.20.0000.02313.09
4.3.10.0070.03313.09
4.3.00.0100.02013.09

preferences:
33.24 ms | 401 KiB | 5 Q