3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printPerson($person) { echo sprintf( "Name: %s | Age: %s | Color: %s" . PHP_EOL, $person["name"], $person["age"], $person["colour"] ); } $people = array( array("name"=>"Bob","age"=>8,"colour"=>"red"), array("name"=>"Greg","age"=>12,"colour"=>"blue"), array("name"=>"Andy","age"=>5,"colour"=>"purple") ); $arrSortArray = array(); foreach($people as $person) { foreach($person as $key=>$value){ if(!isset($arrSortArray[$key])){ $arrSortArray[$key] = array(); } $arrSortArray[$key][] = $person; } } $orderby = "name"; //change this to whatever key you want from the array echo 'BEFORE SORT' . PHP_EOL; foreach ($arrSortArray[$orderby] as $person) { printPerson($person); } array_multisort($arrSortArray[$orderby], SORT_ASC,$people); echo '------------------------'; echo 'AFTER SORT' . PHP_EOL; foreach ($arrSortArray[$orderby] as $person) { printPerson($person); }

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.0040.01216.63
8.3.60.0110.00418.43
8.3.50.0110.00922.04
8.3.40.0030.01218.92
8.3.30.0100.00319.17
8.3.20.0040.00420.34
8.3.10.0040.00420.43
8.3.00.0040.00419.38
8.2.180.0070.00716.88
8.2.170.0120.00322.96
8.2.160.0140.00319.16
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.09
8.2.110.0180.00022.08
8.2.100.0040.00817.72
8.2.90.0040.00419.17
8.2.80.0030.00517.97
8.2.70.0000.00917.63
8.2.60.0000.00818.03
8.2.50.0000.00918.07
8.2.40.0050.00318.34
8.2.30.0000.00719.38
8.2.20.0040.00417.75
8.2.10.0030.00518.09
8.2.00.0040.00417.76
8.1.280.0100.01025.92
8.1.270.0040.00422.01
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00718.55
8.1.230.0070.00719.16
8.1.220.0000.00817.74
8.1.210.0050.00518.77
8.1.200.0030.00617.23
8.1.190.0050.00317.22
8.1.180.0000.00818.10
8.1.170.0030.00618.57
8.1.160.0000.00821.95
8.1.150.0000.00718.90
8.1.140.0040.00417.52
8.1.130.0070.00017.77
8.1.120.0040.00417.49
8.1.110.0000.00817.41
8.1.100.0080.00017.54
8.1.90.0000.00717.45
8.1.80.0080.00017.39
8.1.70.0030.00317.45
8.1.60.0040.00417.49
8.1.50.0030.00517.46
8.1.40.0000.00817.42
8.1.30.0040.00417.64
8.1.20.0040.00417.67
8.1.10.0000.00817.50
8.1.00.0030.00617.53
8.0.300.0060.00318.77
8.0.290.0000.00816.75
8.0.280.0040.00418.51
8.0.270.0030.00317.28
8.0.260.0000.00817.32
8.0.250.0030.00316.99
8.0.240.0040.00416.97
8.0.230.0070.00016.88
8.0.220.0030.00316.89
8.0.210.0000.00716.88
8.0.200.0030.00316.98
8.0.190.0070.00016.96
8.0.180.0000.00716.95
8.0.170.0040.00416.94
8.0.160.0040.00416.86
8.0.150.0000.00716.75
8.0.140.0000.00716.79
8.0.130.0050.00313.36
8.0.120.0000.00816.90
8.0.110.0030.00516.81
8.0.100.0040.00416.80
8.0.90.0020.00516.90
8.0.80.0160.00616.88
8.0.70.0040.00416.98
8.0.60.0000.00716.80
8.0.50.0000.00716.86
8.0.30.0180.00417.32
8.0.20.0060.01217.41
8.0.10.0050.00217.03
8.0.00.0090.00916.98
7.4.330.0000.00615.04
7.4.320.0000.00616.52
7.4.300.0030.00316.58
7.4.290.0040.00416.46
7.4.280.0070.00016.65
7.4.270.0070.00016.64
7.4.260.0040.00316.60
7.4.250.0040.00416.64
7.4.240.0040.00316.58
7.4.230.0040.00416.71
7.4.220.0090.00916.57
7.4.210.0100.00316.65
7.4.200.0000.00716.64
7.4.160.0120.01216.41
7.4.150.0200.02017.40
7.4.140.0090.01017.86
7.4.130.0070.01216.66
7.4.120.0110.00716.46
7.4.110.0060.01016.53
7.4.100.0100.01316.64
7.4.90.0110.00716.64
7.4.80.0100.01319.39
7.4.70.0110.00716.49
7.4.60.0100.00716.55
7.4.50.0050.00316.25
7.4.40.0100.00616.53
7.4.30.0130.00316.77
7.4.00.0060.00914.99
7.3.330.0060.00013.34
7.3.320.0050.00013.19
7.3.310.0040.00416.29
7.3.300.0040.00416.36
7.3.290.0080.00516.41
7.3.280.0090.00716.41
7.3.270.0090.00617.40
7.3.260.0070.01116.46
7.3.250.0090.00916.36
7.3.240.0070.01016.40
7.3.230.0110.01016.39
7.3.210.0110.00816.66
7.3.200.0130.00719.39
7.3.190.0080.00516.67
7.3.180.0100.00616.64
7.3.170.0100.00616.52
7.3.160.0080.00816.45
7.3.120.0040.01214.84
7.3.110.0070.01114.82
7.3.100.0040.01214.84
7.3.90.0060.00914.84
7.3.80.0060.00614.54
7.3.70.0030.00614.92
7.3.60.0040.01114.96
7.3.50.0060.00914.81
7.3.40.0030.01014.95
7.3.30.0070.00715.00
7.3.20.0100.00616.56
7.3.10.0090.00716.52
7.3.00.0080.00516.62
7.2.330.0090.01216.50
7.2.320.0030.01716.71
7.2.310.0090.00916.76
7.2.300.0130.00316.48
7.2.290.0100.01316.77
7.2.240.0110.00715.11
7.2.230.0090.00614.75
7.2.220.0100.01014.87
7.2.210.0100.00615.11
7.2.200.0080.00414.97
7.2.190.0070.00714.92
7.2.180.0070.00715.26
7.2.170.0070.00714.94
7.2.160.0070.01015.27
7.2.150.0040.01216.67
7.2.140.0070.00717.08
7.2.130.0000.01016.97
7.2.120.0040.00716.91
7.2.110.0070.00717.02
7.2.100.0070.00716.93
7.2.90.0070.00516.95
7.2.80.0060.00416.87
7.2.70.0080.00516.82
7.2.60.0070.01016.94
7.2.50.0020.00916.92
7.2.40.0050.00616.87
7.2.30.0070.00516.94
7.2.20.0070.00416.82
7.2.10.0090.00616.78
7.2.00.0040.00917.72
7.1.330.0070.01015.78
7.1.320.0090.00915.71
7.1.310.0070.00715.79
7.1.300.0030.01015.85
7.1.290.0090.00315.81
7.1.280.0040.01115.75
7.1.270.0080.00815.75
7.1.260.0030.00915.87
7.1.250.0100.00515.59
7.1.240.0040.01115.60
7.1.230.0000.01315.76
7.1.220.0030.00315.86
7.1.210.0040.01115.89
7.1.200.0140.00015.92
7.1.190.0070.01015.81
7.1.180.0100.00315.92
7.1.170.0030.01015.83
7.1.160.0000.01715.75
7.1.150.0000.01215.68
7.1.140.0040.00815.70
7.1.130.0090.00916.04
7.1.120.0040.01115.59
7.1.110.0030.01015.88
7.1.100.0050.00816.84
7.1.90.0040.01115.55
7.1.80.0000.01315.80
7.1.70.0020.00616.38
7.1.60.0060.01017.41
7.1.50.0050.01316.48
7.1.40.0060.00615.82
7.1.30.0030.00615.84
7.1.20.0140.00015.76
7.1.10.0060.00315.92
7.1.00.0050.04219.03
7.0.330.0000.01415.63
7.0.320.0030.00915.38
7.0.310.0080.00815.34
7.0.300.0070.00715.46
7.0.290.0050.00515.03
7.0.280.0040.01115.49
7.0.270.0030.01015.25
7.0.260.0030.00515.34
7.0.250.0030.01015.56
7.0.240.0000.01415.54
7.0.230.0100.00715.20
7.0.220.0100.00315.09
7.0.210.0100.00415.40
7.0.200.0030.00716.13
7.0.190.0000.00915.27
7.0.180.0000.01315.31
7.0.170.0040.01115.40
7.0.160.0000.01015.36
7.0.150.0060.00915.07
7.0.140.0040.03918.59
7.0.130.0090.00615.09
7.0.120.0040.00415.58
7.0.110.0030.01015.40
7.0.100.0000.01415.29
7.0.90.0110.00415.48
7.0.80.0000.01315.14
7.0.70.0070.00715.52
7.0.60.0100.03517.65
7.0.50.0100.03016.65
7.0.40.0070.02516.96
7.0.30.0150.03416.95
7.0.20.0130.04516.88
7.0.10.0080.04516.66
7.0.00.0070.05016.80
5.6.380.0000.01414.63
5.6.370.0030.01314.60
5.6.360.0040.00413.98
5.6.350.0040.01114.45
5.6.340.0060.00914.45
5.6.330.0040.01214.11
5.6.320.0050.00514.39
5.6.310.0060.00914.40
5.6.300.0100.00314.13
5.6.290.0040.01114.21
5.6.280.0030.04217.80
5.6.270.0000.01714.17
5.6.260.0030.01414.31
5.6.250.0070.00714.42
5.6.240.0070.00314.18
5.6.230.0030.01114.24
5.6.220.0000.01314.54
5.6.210.0050.04817.46
5.6.200.0040.02816.20
5.6.190.0030.05017.60
5.6.180.0100.02817.32
5.6.170.0130.03017.37
5.6.160.0080.03017.38
5.6.150.0060.02816.42
5.6.140.0120.03016.45
5.6.130.0080.04716.37
5.6.120.0000.04217.66
5.6.110.0070.03517.66
5.6.100.0050.03317.69
5.6.90.0070.03217.87
5.6.80.0030.04517.40
5.6.70.1980.02217.36
5.6.60.0080.00514.64
5.6.50.0060.00613.84
5.6.40.0070.00314.43
5.6.30.0080.00414.65
5.6.20.0100.00614.37
5.6.10.0040.00414.52
5.6.00.0080.00414.43
5.5.380.0000.01311.23
5.5.370.0040.00711.08
5.5.360.0070.00411.50
5.5.350.0120.04615.81
5.5.340.0050.02514.65
5.5.330.0070.04315.80
5.5.320.0110.04115.91
5.5.310.0120.03015.71
5.5.300.0050.02614.71
5.5.290.0050.04314.41
5.5.280.0060.04116.01
5.5.270.0090.04316.02
5.5.260.0080.03815.95
5.5.250.0030.04816.01
5.5.240.0240.03115.79
5.5.230.0030.00311.13
5.5.220.0000.01010.97
5.5.210.0040.00411.25
5.5.200.0070.00011.03
5.5.190.0030.00311.07
5.5.180.0050.00011.05
5.5.170.0090.00311.17
5.5.160.0070.00011.11
5.5.150.0030.00611.19
5.5.140.0040.00811.38
5.5.130.0000.00611.23
5.5.120.0000.00811.24
5.5.110.0000.00911.03
5.5.100.0030.00911.36
5.5.90.0030.00311.21
5.5.80.0030.00610.97
5.5.70.0070.00411.40
5.5.60.0050.00011.28
5.5.50.0070.00311.38
5.5.40.0080.00311.46
5.5.30.0110.00411.16
5.5.20.0000.00811.29
5.5.10.0070.00411.21
5.5.00.0030.00611.04
5.4.450.0190.02515.29
5.4.440.0150.02315.50
5.4.430.0080.03015.39
5.4.420.0050.02615.45
5.4.410.0210.01815.34
5.4.400.0290.01715.17
5.4.390.0170.02015.43
5.4.380.0180.03515.03
5.4.370.0200.02914.97
5.4.360.0210.03414.93
5.4.350.0230.03814.91
5.4.340.0130.03615.00
5.4.330.0050.00511.19
5.4.320.0030.02311.75
5.4.310.0070.02111.85
5.4.300.0070.01911.83
5.4.290.0020.02511.72
5.4.280.0040.02211.84
5.4.270.0050.02311.88
5.4.260.0050.02111.89
5.4.250.0030.02311.77
5.4.240.0040.02411.89
5.4.230.0030.02411.73
5.4.220.0050.02111.67
5.4.210.0020.02411.58
5.4.200.0060.02511.85
5.4.190.0090.02611.87
5.4.180.0100.02011.75
5.4.170.0050.02711.77
5.4.160.0050.02411.76
5.4.150.0020.02511.89
5.4.140.0070.02111.65
5.4.130.0100.02111.59
5.4.120.0050.02411.45
5.4.110.0060.02211.63
5.4.100.0050.02011.73
5.4.90.0070.02011.70
5.4.80.0050.02911.54
5.4.70.0070.02011.53
5.4.60.0060.02011.65
5.4.50.0040.02111.50
5.4.40.0060.02011.60
5.4.30.0040.02511.52
5.4.20.0050.02111.59
5.4.10.0070.02111.60
5.4.00.0070.02511.25
5.3.290.0070.02911.73
5.3.280.0080.02611.62
5.3.270.0100.02111.58
5.3.260.0060.02111.71
5.3.250.0030.02511.66
5.3.240.0060.03011.62
5.3.230.0060.02011.66
5.3.220.0030.02111.64
5.3.210.0040.02511.62
5.3.200.0070.02411.46
5.3.190.0060.02111.51
5.3.180.0040.03011.71
5.3.170.0080.02411.69
5.3.160.0070.02611.75
5.3.150.0040.03111.67
5.3.140.0040.02311.54
5.3.130.0080.02011.54
5.3.120.0050.02211.66
5.3.110.0050.02411.65
5.3.100.0070.02011.27
5.3.90.0050.02311.38
5.3.80.0040.02711.31
5.3.70.0060.02711.31
5.3.60.0090.02311.32
5.3.50.0040.02511.32
5.3.40.0080.02211.16
5.3.30.0070.02211.33
5.3.20.0050.02011.16
5.3.10.0040.02311.05
5.3.00.0090.01910.93
5.2.170.0050.0199.58
5.2.160.0030.0199.58
5.2.150.0020.0199.58
5.2.140.0050.0179.57
5.2.130.0030.0169.56
5.2.120.0060.0159.56
5.2.110.0020.0189.56
5.2.100.0050.0169.56
5.2.90.0020.0259.56
5.2.80.0070.0219.56
5.2.70.0060.0199.56
5.2.60.0010.0229.54
5.2.50.0040.0199.52
5.2.40.0050.0199.51
5.2.30.0020.0189.49
5.2.20.0020.0209.49
5.2.10.0070.0149.44
5.2.00.0060.0159.38
5.1.60.0050.0149.02
5.1.50.0050.0149.01
5.1.40.0050.0149.00
5.1.30.0070.0129.18
5.1.20.0050.0149.19
5.1.10.0020.0169.05
5.1.00.0040.0199.05
5.0.50.0060.0108.29
5.0.40.0020.0158.22
5.0.30.0040.0228.13
5.0.20.0020.0138.11
5.0.10.0010.0198.10
5.0.00.0030.0188.10
4.4.90.0040.0137.35
4.4.80.0030.0107.34
4.4.70.0020.0117.34
4.4.60.0030.0137.34
4.4.50.0010.0107.35
4.4.40.0050.0137.32
4.4.30.0000.0137.34
4.4.20.0020.0107.39
4.4.10.0010.0117.39
4.4.00.0040.0147.34
4.3.110.0050.0087.30
4.3.100.0020.0107.29
4.3.90.0020.0097.28
4.3.80.0020.0147.25
4.3.70.0020.0107.28
4.3.60.0010.0127.28
4.3.50.0020.0097.28
4.3.40.0030.0167.23
4.3.30.0010.0126.63
4.3.20.0040.0086.62
4.3.10.0020.0106.60
4.3.00.0050.00814.69

preferences:
32.52 ms | 401 KiB | 5 Q