3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printPerson($person) { sprintf( "Name: %s | Age: %s | Color: %s <br />", $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 foreach ($arrSortArray[$orderby] as $person) { printPerson($person); } array_multisort($arrSortArray[$orderby], SORT_ASC,$people); 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.0070.00716.63
8.3.60.0090.00618.55
8.3.50.0130.00921.89
8.3.40.0070.00718.63
8.3.30.0140.00319.21
8.3.20.0000.00820.02
8.3.10.0080.00020.48
8.3.00.0050.00319.51
8.2.180.0070.01316.50
8.2.170.0110.00722.96
8.2.160.0030.01020.39
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0050.00222.04
8.2.110.0030.00620.25
8.2.100.0060.00618.09
8.2.90.0040.00419.19
8.2.80.0060.00317.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0000.00818.34
8.2.30.0070.00019.38
8.2.20.0040.00417.78
8.2.10.0050.00318.02
8.2.00.0040.00417.64
8.1.280.0140.00725.92
8.1.270.0000.00822.01
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0080.00023.90
8.1.230.0080.00419.00
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0090.00017.35
8.1.190.0030.00517.25
8.1.180.0060.00318.10
8.1.170.0000.00818.59
8.1.160.0050.00222.02
8.1.150.0040.00418.94
8.1.140.0040.00417.37
8.1.130.0000.00717.81
8.1.120.0040.00417.41
8.1.110.0000.00717.38
8.1.100.0000.00817.47
8.1.90.0040.00417.43
8.1.80.0070.00017.38
8.1.70.0040.00417.48
8.1.60.0000.00817.59
8.1.50.0030.00617.56
8.1.40.0030.00617.44
8.1.30.0030.00517.61
8.1.20.0000.00817.58
8.1.10.0040.00417.63
8.1.00.0040.00417.39
8.0.300.0040.00418.77
8.0.290.0080.00016.63
8.0.280.0070.00018.46
8.0.270.0030.00317.28
8.0.260.0000.00817.27
8.0.250.0030.00316.98
8.0.240.0040.00416.87
8.0.230.0050.00216.93
8.0.220.0000.00716.83
8.0.210.0070.00016.93
8.0.200.0030.00316.96
8.0.190.0040.00416.98
8.0.180.0030.00316.95
8.0.170.0040.00416.95
8.0.160.0040.00416.96
8.0.150.0080.00016.89
8.0.140.0000.00716.75
8.0.130.0040.00413.30
8.0.120.0040.00416.87
8.0.110.0000.00716.90
8.0.100.0000.00716.95
8.0.90.0000.00716.85
8.0.80.0000.02116.84
8.0.70.0000.00816.98
8.0.60.0070.00016.85
8.0.50.0080.00016.97
8.0.30.0090.00916.99
8.0.20.0110.00717.40
8.0.10.0040.00417.06
8.0.00.0120.00516.86
7.4.330.0050.00015.02
7.4.320.0030.00516.50
7.4.300.0030.00316.61
7.4.290.0030.00316.61
7.4.280.0000.00916.52
7.4.270.0030.00316.55
7.4.260.0000.00716.45
7.4.250.0000.00716.39
7.4.240.0050.00316.55
7.4.230.0070.00016.73
7.4.220.0100.00716.56
7.4.210.0120.00416.50
7.4.200.0000.00716.61
7.4.160.0100.00616.33
7.4.150.0120.00617.40
7.4.140.0130.00517.86
7.4.130.0100.00716.46
7.4.120.0140.00816.63
7.4.110.0070.01016.46
7.4.100.0060.01216.56
7.4.90.0070.01016.44
7.4.80.0040.01519.39
7.4.70.0130.01216.53
7.4.60.0040.01316.39
7.4.50.0040.00416.39
7.4.40.0060.01216.57
7.4.30.0060.01016.62
7.4.00.0100.00814.75
7.3.330.0000.00613.35
7.3.320.0030.00313.38
7.3.310.0000.00716.29
7.3.300.0070.00016.27
7.3.290.0040.01116.30
7.3.280.0070.01216.41
7.3.270.0000.01717.40
7.3.260.0070.01016.41
7.3.250.0070.01116.70
7.3.240.0110.01016.64
7.3.230.0090.00916.39
7.3.210.0120.00616.46
7.3.200.0150.00819.39
7.3.190.0230.00416.37
7.3.180.0080.00816.50
7.3.170.0080.00816.59
7.3.160.0100.00616.43
7.3.120.0110.00715.03
7.3.110.0070.01014.80
7.3.100.0060.00614.84
7.3.90.0120.00014.98
7.3.80.0030.00614.84
7.3.70.0060.00314.81
7.3.60.0050.00314.42
7.3.50.0060.00614.65
7.3.40.0130.00014.79
7.3.30.0000.00814.84
7.3.20.0060.00616.58
7.3.10.0060.00716.61
7.3.00.0070.00616.51
7.2.330.0110.01216.64
7.2.320.0150.00316.72
7.2.310.0000.01616.72
7.2.300.0150.00316.47
7.2.290.0060.01316.55
7.2.250.0060.01315.25
7.2.240.0030.01315.19
7.2.230.0080.00614.69
7.2.220.0040.01214.97
7.2.210.0090.00614.97
7.2.200.0030.01015.24
7.2.190.0000.01014.95
7.2.180.0100.00315.15
7.2.170.0120.00314.92
7.2.130.0080.00816.97
7.2.120.0070.00816.93
7.2.110.0000.01317.07
7.2.100.0090.00516.87
7.2.90.0090.00616.80
7.2.80.0050.01016.97
7.2.70.0050.00917.01
7.2.60.0090.00916.88
7.2.50.0080.00516.89
7.2.40.0040.01016.82
7.2.30.0080.00616.97
7.2.20.0070.00716.74
7.2.10.0090.00616.91
7.2.00.0080.00316.98
7.1.330.0090.00315.80
7.1.320.0080.00415.73
7.1.310.0060.00915.75
7.1.300.0000.00915.61
7.1.290.0030.00915.61
7.1.280.0060.00615.92
7.1.270.0030.01015.75
7.1.260.0030.01015.53
7.1.250.0030.00815.94
7.1.240.0090.00415.87
7.1.230.0070.00715.69
7.1.220.0150.00015.91
7.1.210.0100.00315.82
7.1.200.0060.00715.51
7.1.190.0130.00615.94
7.1.180.0030.01015.93
7.1.170.0060.00915.77
7.1.160.0000.01315.79
7.1.150.0090.00315.93
7.1.140.0090.00615.55
7.1.130.0040.00415.89
7.1.120.0040.01115.84
7.1.110.0030.01015.79
7.1.100.0100.00315.87
7.1.90.0090.00315.52
7.1.80.0070.00715.89
7.1.70.0020.00816.35
7.1.60.0080.01217.42
7.1.50.0070.01216.43
7.1.40.0040.01115.76
7.1.30.0100.00315.76
7.1.20.0070.00715.68
7.1.10.0060.00915.96
7.1.00.0090.03819.19
7.0.330.0080.00415.48
7.0.320.0080.00415.52
7.0.310.0100.00715.55
7.0.300.0000.00815.25
7.0.290.0100.00315.40
7.0.280.0160.00015.47
7.0.270.0070.00715.62
7.0.260.0060.00615.36
7.0.250.0030.01015.20
7.0.240.0000.01315.08
7.0.230.0090.00315.49
7.0.220.0080.00415.42
7.0.210.0100.00315.45
7.0.200.0020.00516.00
7.0.190.0000.01015.65
7.0.180.0000.01615.45
7.0.170.0090.00015.58
7.0.160.0030.01015.23
7.0.150.0040.00815.29
7.0.140.0020.04418.62
7.0.130.0040.00415.46
7.0.120.0070.01015.53
7.0.110.0000.01415.20
7.0.100.0040.00415.55
7.0.90.0050.00515.50
7.0.80.0100.00315.30
7.0.70.0040.00715.57
7.0.60.0070.04618.60
7.0.50.0030.04216.78
7.0.40.0080.04316.81
7.0.30.0150.04616.83
7.0.20.0120.04316.84
7.0.10.0040.02716.85
7.0.00.0090.02716.82
5.6.380.0090.00614.34
5.6.370.0030.00914.48
5.6.360.0040.00814.29
5.6.350.0040.01114.15
5.6.340.0030.00614.54
5.6.330.0040.01114.29
5.6.320.0040.01214.47
5.6.310.0000.01514.52
5.6.300.0070.00714.24
5.6.290.0040.01114.31
5.6.280.0020.04417.74
5.6.270.0090.00314.23
5.6.260.0100.00314.43
5.6.250.0120.00014.55
5.6.240.0070.01014.11
5.6.230.0040.01114.48
5.6.220.0040.00414.39
5.6.210.0030.02317.54
5.6.200.0050.03216.27
5.6.190.0080.04317.36
5.6.180.0100.03517.43
5.6.170.0170.04217.45
5.6.160.0080.03617.33
5.6.150.0050.04316.39
5.6.140.0100.03516.19
5.6.130.0020.04716.31
5.6.120.0130.03817.79
5.6.110.0070.03717.79
5.6.100.0020.03417.70
5.6.90.0050.04917.63
5.6.80.0110.04117.44
5.6.70.0060.00314.11
5.6.60.0060.00614.29
5.6.50.0030.00614.46
5.6.40.0000.01514.40
5.6.30.0090.00314.28
5.6.20.0090.00314.54
5.6.10.0000.01114.34
5.6.00.0090.00314.68
5.5.380.0060.00611.21
5.5.370.0060.00611.30
5.5.360.0030.00311.12
5.5.350.2030.01515.92
5.5.340.0090.02514.63
5.5.330.0050.03315.57
5.5.320.0150.04215.71
5.5.310.0130.04415.78
5.5.300.0100.04214.58
5.5.290.0080.01914.61
5.5.280.0070.04315.80
5.5.270.0110.04116.16
5.5.260.0050.04615.97
5.5.250.0100.03815.87
5.5.240.0120.03315.67
5.5.230.0100.00011.44
5.5.220.0040.00711.22
5.5.210.0040.00411.20
5.5.200.0060.00611.16
5.5.190.0030.00811.29
5.5.180.0030.00911.04
5.5.170.0060.00611.02
5.5.160.0060.00611.50
5.5.150.0030.00610.93
5.5.140.0050.00311.16
5.5.130.0060.00311.15
5.5.120.0000.00811.50
5.5.110.0000.00610.99
5.5.100.0040.00411.06
5.5.90.0060.00011.00
5.5.80.0040.00411.07
5.5.70.0000.00811.35
5.5.60.0100.00011.16
5.5.50.0040.00811.32
5.5.40.0030.00311.32
5.5.30.0000.00811.29
5.5.20.0000.00611.48
5.5.10.0110.00011.03
5.5.00.0070.00710.86
5.4.450.0220.02515.37
5.4.440.0210.02915.30
5.4.430.0120.02515.33
5.4.420.0190.02015.25
5.4.410.0190.02415.38
5.4.400.0120.02215.25
5.4.390.0130.02915.19
5.4.380.0150.04214.66
5.4.370.0150.04014.86
5.4.360.0120.03514.91
5.4.350.0250.03015.10
5.4.340.0170.02914.92
5.4.330.0000.00811.02
5.4.320.0040.02211.78
5.4.310.0070.02111.97
5.4.300.0020.02411.97
5.4.290.0040.02211.77
5.4.280.0020.02211.72
5.4.270.0050.02011.92
5.4.260.0050.02111.86
5.4.250.0040.02411.89
5.4.240.0040.02111.60
5.4.230.0020.02211.76
5.4.220.0110.01911.60
5.4.210.0040.02011.87
5.4.200.0030.02311.76
5.4.190.0060.02011.58
5.4.180.0040.02311.53
5.4.170.0060.02111.67
5.4.160.0040.02111.78
5.4.150.0060.02011.77
5.4.140.0060.02111.64
5.4.130.0040.02211.69
5.4.120.0020.02311.56
5.4.110.0040.02211.59
5.4.100.0020.02411.40
5.4.90.0060.02111.58
5.4.80.0090.01811.43
5.4.70.0060.01811.68
5.4.60.0080.01911.62
5.4.50.0080.02111.62
5.4.40.0070.02211.54
5.4.30.0020.02411.55
5.4.20.0050.02411.63
5.4.10.0080.01911.55
5.4.00.0020.02311.21
5.3.290.0060.02211.68
5.3.280.0070.02111.65
5.3.270.0050.02611.59
5.3.260.0070.02511.72
5.3.250.0020.03111.68
5.3.240.0040.02511.66
5.3.230.0090.01911.54
5.3.220.0060.02111.64
5.3.210.0040.02111.64
5.3.200.0040.02211.62
5.3.190.0040.02111.66
5.3.180.0070.01711.73
5.3.170.0060.01911.60
5.3.160.0060.01911.70
5.3.150.0040.02311.59
5.3.140.0040.02311.68
5.3.130.0040.02511.52
5.3.120.0060.02211.66
5.3.110.0060.02111.60
5.3.100.0020.02711.46
5.3.90.0060.02511.39
5.3.80.0040.02311.21
5.3.70.0050.02011.32
5.3.60.0070.01811.34
5.3.50.0030.02511.32
5.3.40.0060.02111.17
5.3.30.0040.02011.34
5.3.20.0060.01911.20
5.3.10.0020.02111.04
5.3.00.0040.02311.07
5.2.170.0040.0229.28
5.2.160.0020.0179.36
5.2.150.0040.0179.34
5.2.140.0060.0149.41
5.2.130.0040.0179.24
5.2.120.0040.0169.26
5.2.110.0050.0159.24
5.2.100.0020.0209.41
5.2.90.0030.0199.35
5.2.80.0010.0199.32
5.2.70.0020.0199.32
5.2.60.0020.0219.29
5.2.50.0020.0209.25
5.2.40.0020.0179.26
5.2.30.0040.0169.27
5.2.20.0030.0179.17
5.2.10.0040.0169.12
5.2.00.0050.0169.06
5.1.60.0020.0148.69
5.1.50.0030.0178.69
5.1.40.0030.0148.68
5.1.30.0040.0168.86
5.1.20.0050.0178.87
5.1.10.0020.0158.73
5.1.00.0050.0138.73
5.0.50.0040.0107.97
5.0.40.0020.0147.90
5.0.30.0010.0207.81
5.0.20.0040.0127.79
5.0.10.0020.0137.78
5.0.00.0020.0227.78
4.4.90.0030.0097.04
4.4.80.0020.0107.02
4.4.70.0010.0157.03
4.4.60.0010.0127.03
4.4.50.0040.0077.03
4.4.40.0020.0147.00
4.4.30.0030.0097.03
4.4.20.0020.0107.07
4.4.10.0050.0097.07
4.4.00.0010.0167.02
4.3.110.0020.0106.98
4.3.100.0030.0096.98
4.3.90.0040.0086.96
4.3.80.0020.0156.94
4.3.70.0040.0096.96
4.3.60.0030.0096.96
4.3.50.0020.0106.96
4.3.40.0020.0166.91
4.3.30.0010.0126.31
4.3.20.0020.0096.30
4.3.10.0030.0096.28
4.3.00.0040.00814.37

preferences:
49.74 ms | 401 KiB | 5 Q