3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!defined('PHP_EOL')) { define('PHP_EOL', "\n"); } 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 = "colour"; //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 '------------------------' . PHP_EOL; 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.60.0140.00718.68
8.3.50.0120.01022.06
8.3.40.0110.00418.84
8.3.30.0070.00719.09
8.3.20.0070.00020.20
8.3.10.0090.00020.69
8.3.00.0080.00019.37
8.2.180.0100.01016.75
8.2.170.0140.00422.96
8.2.160.0060.00920.33
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0000.00726.16
8.2.120.0040.00422.06
8.2.110.0060.00322.25
8.2.100.0080.00417.89
8.2.90.0040.00417.75
8.2.80.0000.00817.97
8.2.70.0000.00817.89
8.2.60.0030.00617.93
8.2.50.0040.00418.10
8.2.40.0000.01020.30
8.2.30.0050.00319.32
8.2.20.0050.00317.73
8.2.10.0090.00018.18
8.2.00.0000.00717.70
8.1.280.0110.01125.92
8.1.270.0030.00522.05
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00322.14
8.1.230.0030.00919.01
8.1.220.0040.00417.77
8.1.210.0050.00318.77
8.1.200.0090.00017.35
8.1.190.0080.00017.36
8.1.180.0160.00818.10
8.1.170.0000.00918.57
8.1.160.0050.00222.00
8.1.150.0040.00418.93
8.1.140.0000.00817.37
8.1.130.0030.00317.89
8.1.120.0040.00417.36
8.1.110.0040.00417.42
8.1.100.0000.00717.45
8.1.90.0000.00717.34
8.1.80.0030.00417.47
8.1.70.0000.00717.41
8.1.60.0040.00417.47
8.1.50.0090.00017.58
8.1.40.0070.00317.43
8.1.30.0000.00817.68
8.1.20.0000.00817.54
8.1.10.0050.00317.54
8.1.00.0000.00717.39
8.0.300.0050.00519.80
8.0.290.0000.00716.88
8.0.280.0000.00818.43
8.0.270.0000.00717.14
8.0.260.0000.00717.21
8.0.250.0050.00316.99
8.0.240.0000.00816.89
8.0.230.0000.00717.01
8.0.220.0000.00716.95
8.0.210.0030.00316.90
8.0.200.0000.00717.08
8.0.190.0000.00717.03
8.0.180.0040.00417.00
8.0.170.0050.00316.86
8.0.160.0030.00316.98
8.0.150.0070.00016.90
8.0.140.0040.00416.84
8.0.130.0030.00313.37
8.0.120.0000.00916.82
8.0.110.0030.00516.86
8.0.100.0040.00416.89
8.0.90.0050.00216.84
8.0.80.0100.00716.96
8.0.70.0040.00416.85
8.0.60.0000.00816.91
8.0.50.0070.00016.92
8.0.30.0110.00717.19
8.0.20.0140.00617.40
8.0.10.0050.00316.96
8.0.00.0110.00916.73
7.4.330.0000.00515.08
7.4.320.0030.00316.51
7.4.300.0060.00016.62
7.4.290.0060.00016.52
7.4.280.0040.00416.64
7.4.270.0000.00716.61
7.4.260.0000.00716.58
7.4.250.0070.00016.37
7.4.240.0010.00616.63
7.4.230.0040.00416.71
7.4.220.0090.00916.64
7.4.210.0070.00716.45
7.4.200.0070.00016.40
7.4.160.0110.00716.59
7.4.150.0070.02017.40
7.4.140.0110.00617.86
7.4.130.0080.00916.55
7.4.120.0090.00616.58
7.4.110.0120.01216.48
7.4.100.0090.01216.72
7.4.90.0150.00316.53
7.4.80.0110.01119.39
7.4.70.0050.01416.49
7.4.60.0030.01316.32
7.4.50.0060.00316.72
7.4.40.0090.00616.63
7.4.30.0100.00616.57
7.4.00.0030.01314.91
7.3.330.0020.00513.50
7.3.320.0000.00513.21
7.3.310.0040.00416.53
7.3.300.0060.00016.44
7.3.290.0050.00916.43
7.3.280.0060.01016.43
7.3.270.0140.00417.40
7.3.260.0120.00416.55
7.3.250.0090.00916.54
7.3.240.0040.01816.69
7.3.230.0030.01716.68
7.3.210.0110.01116.55
7.3.200.0070.01119.39
7.3.190.0060.01616.62
7.3.180.0170.00316.52
7.3.170.0070.01116.47
7.3.160.0060.00916.72
7.3.120.0070.00714.91
7.3.110.0150.00415.07
7.3.100.0100.01015.09
7.3.90.0110.00314.86
7.3.80.0070.00414.93
7.3.70.0080.00414.80
7.3.60.0030.00614.49
7.3.50.0030.01014.83
7.3.40.0040.01114.85
7.3.30.0060.00614.92
7.3.20.0040.01516.56
7.3.10.0040.01116.77
7.3.00.0040.00716.73
7.2.330.0200.00016.66
7.2.320.0110.01116.81
7.2.310.0140.00416.76
7.2.300.0110.01216.72
7.2.290.0030.01416.62
7.2.250.0100.01015.22
7.2.240.0070.01015.17
7.2.230.0000.01415.08
7.2.220.0040.01615.22
7.2.210.0080.00314.98
7.2.200.0030.01015.05
7.2.190.0030.01314.99
7.2.180.0060.00615.20
7.2.170.0030.01015.06
7.2.160.0080.00815.19
7.2.150.0000.01817.11
7.2.140.0030.01216.91
7.2.130.0060.01016.61
7.2.120.0000.01717.00
7.2.110.0060.01316.92
7.2.100.0070.01116.84
7.2.90.0080.00416.82
7.2.80.0060.01316.98
7.2.70.0100.00017.04
7.2.60.0140.00317.01
7.2.50.0000.01517.05
7.2.40.0060.00916.80
7.2.30.0100.00316.98
7.2.20.0040.01216.85
7.2.10.0060.00916.73
7.2.00.0040.00718.25
7.1.330.0000.01615.66
7.1.320.0000.01515.84
7.1.310.0060.00615.50
7.1.300.0000.01115.48
7.1.290.0060.00615.86
7.1.280.0030.00715.78
7.1.270.0060.01615.84
7.1.260.0100.00315.82
7.1.250.0040.01115.80
7.1.240.0000.01815.82
7.1.230.0030.01315.76
7.1.220.0040.00415.94
7.1.210.0070.01016.05
7.1.200.0000.01515.88
7.1.190.0040.00715.61
7.1.180.0060.01215.49
7.1.170.0090.00015.75
7.1.160.0030.01015.81
7.1.150.0060.00615.91
7.1.140.0030.01015.82
7.1.130.0100.00715.61
7.1.120.0060.00315.96
7.1.110.0000.01215.81
7.1.100.0080.00916.99
7.1.90.0000.01415.87
7.1.80.0060.00615.89
7.1.70.0050.00516.45
7.1.60.0060.01117.53
7.1.50.0050.01616.31
7.1.40.0100.00715.59
7.1.30.0060.00616.01
7.1.20.0030.01115.86
7.1.10.0070.00715.63
7.1.00.0060.04319.18
7.0.330.0070.00715.24
7.0.320.0030.00715.41
7.0.310.0040.00815.46
7.0.300.0060.00615.09
7.0.290.0140.00015.36
7.0.280.0000.00915.09
7.0.270.0100.00315.43
7.0.260.0040.01115.34
7.0.250.0000.00915.10
7.0.240.0130.00715.23
7.0.230.0060.00615.26
7.0.220.0040.00815.50
7.0.210.0060.00615.30
7.0.200.0050.01216.09
7.0.190.0070.00715.25
7.0.180.0100.00015.40
7.0.170.0000.01215.34
7.0.160.0030.00615.37
7.0.150.0040.01115.46
7.0.140.0050.04418.73
7.0.130.0000.01215.40
7.0.120.0030.01215.27
7.0.110.0030.00715.51
7.0.100.0080.00815.25
7.0.90.0030.01315.17
7.0.80.0050.00515.43
7.0.70.0070.00715.60
7.0.60.0050.02617.56
7.0.50.0030.04716.69
7.0.40.0030.02516.88
7.0.30.0270.03416.95
7.0.20.0130.03616.91
7.0.10.0080.04616.83
7.0.00.0110.02116.78
5.6.400.0030.01014.54
5.6.390.0060.01214.37
5.6.380.0060.01114.29
5.6.370.0000.01314.55
5.6.360.0000.01314.50
5.6.350.0030.00614.49
5.6.340.0000.01214.16
5.6.330.0040.00814.61
5.6.320.0100.00714.25
5.6.310.0070.00714.14
5.6.300.0040.01613.99
5.6.290.0100.00714.22
5.6.280.0030.04317.79
5.6.270.0070.01014.43
5.6.260.0070.01014.70
5.6.250.0060.01014.66
5.6.240.0100.01014.69
5.6.230.0000.00814.62
5.6.220.0040.01214.38
5.6.210.0050.02217.41
5.6.200.0080.04416.35
5.6.190.0050.02817.39
5.6.180.2170.02017.51
5.6.170.0220.02217.32
5.6.160.0030.03717.51
5.6.150.0050.03916.28
5.6.140.0080.04316.35
5.6.130.0100.04016.32
5.6.120.0070.04517.73
5.6.110.0070.02217.71
5.6.100.0070.02617.70
5.6.90.0020.05017.59
5.6.80.0100.04017.38
5.6.70.2230.02117.55
5.6.60.0030.00914.44
5.6.50.0070.00414.41
5.6.40.0070.01014.48
5.6.30.0080.00814.57
5.6.20.0030.00914.51
5.6.10.0000.01214.06
5.6.00.0050.00514.48
5.5.380.0030.01014.26
5.5.370.0070.01014.07
5.5.360.0000.01414.16
5.5.350.0090.02417.38
5.5.340.0100.04316.13
5.5.330.0050.04317.54
5.5.320.0250.02817.37
5.5.310.0100.03317.41
5.5.300.0070.03016.18
5.5.290.0090.02016.27
5.5.280.0040.02917.52
5.5.270.0070.04517.72
5.5.260.0100.03117.61
5.5.250.0100.03317.62
5.5.240.0000.04617.10
5.5.230.0030.01014.02
5.5.220.0100.00314.16
5.5.210.0030.01013.93
5.5.200.0030.01014.03
5.5.190.0060.00914.16
5.5.180.0060.00614.39
5.5.170.0060.00614.09
5.5.160.0100.00314.45
5.5.150.0030.01014.38
5.5.140.0070.00713.79
5.5.130.0090.00614.50
5.5.120.0090.00314.64
5.5.110.0040.01114.12
5.5.100.0070.00714.47
5.5.90.0040.01114.51
5.5.80.0050.00814.08
5.5.70.0000.01114.50
5.5.60.0070.00714.27
5.5.50.0030.01014.27
5.5.40.0040.01114.55
5.5.30.0090.00614.25
5.5.20.0070.00714.30
5.5.10.0110.00414.49
5.5.00.0040.01414.16
5.4.450.0110.03015.76
5.4.440.0280.01815.73
5.4.430.0140.02615.73
5.4.420.0240.02215.75
5.4.410.0210.02615.73
5.4.400.0400.02215.73
5.4.390.0210.02515.73
5.4.380.0250.03915.27
5.4.370.0230.03015.38
5.4.360.0170.03115.39
5.4.350.0230.03015.27
5.4.340.0130.03215.31
5.4.330.0000.01112.00
5.4.320.0030.03312.26
5.4.310.0070.02212.26
5.4.300.0050.02212.26
5.4.290.0040.03312.26
5.4.280.0050.02612.20
5.4.270.0070.02712.21
5.4.260.0060.02212.21
5.4.250.0050.02112.21
5.4.240.0050.02212.21
5.4.230.0070.02212.20
5.4.220.0040.02312.20
5.4.210.0050.02112.20
5.4.200.0100.01612.20
5.4.190.0090.01612.20
5.4.180.0050.02212.20
5.4.170.0050.01912.21
5.4.160.0040.02912.20
5.4.150.0080.01812.20
5.4.140.0090.02512.04
5.4.130.0050.02112.03
5.4.120.0070.02212.01
5.4.110.0040.02912.01
5.4.100.0030.02612.01
5.4.90.0050.02512.01
5.4.80.0090.01812.01
5.4.70.0050.02012.01
5.4.60.0040.02212.01
5.4.50.0040.02212.01
5.4.40.0040.02012.00
5.4.30.0040.02112.00
5.4.20.0070.01912.00
5.4.10.0060.01812.00
5.4.00.0050.02111.75
5.3.290.0100.03612.80
5.3.280.0140.03612.70
5.3.270.0080.03612.72
5.3.260.0090.03612.72
5.3.250.0070.03612.72
5.3.240.0070.03812.72
5.3.230.0040.04312.71
5.3.220.0050.03912.68
5.3.210.0110.04012.68
5.3.200.0040.03912.68
5.3.190.0050.03912.68
5.3.180.0070.03612.68
5.3.170.0050.03712.67
5.3.160.0050.03612.68
5.3.150.0050.03712.67
5.3.140.0030.03912.66
5.3.130.0060.03812.66
5.3.120.0080.03612.66
5.3.110.0090.03912.65
5.3.100.0080.03812.13
5.3.90.0080.03912.11
5.3.80.0040.03712.11
5.3.70.0070.03512.11
5.3.60.0110.03112.09
5.3.50.0080.03412.04
5.3.40.0060.03612.04
5.3.30.0050.03612.00
5.3.20.0070.03411.78
5.3.10.0030.03711.74
5.3.00.0040.03711.73
5.2.170.0050.0309.23
5.2.160.0070.0279.23
5.2.150.0080.0279.23
5.2.140.0060.0309.23
5.2.130.0050.0289.19
5.2.120.0020.0319.19
5.2.110.0040.0299.20
5.2.100.0030.0359.20
5.2.90.0050.0279.20
5.2.80.0030.0319.19
5.2.70.0070.0369.18
5.2.60.0060.0399.14
5.2.50.0040.0319.11
5.2.40.0070.0269.09
5.2.30.0110.0369.06
5.2.20.0080.0339.05
5.2.10.0030.0308.95
5.2.00.0080.0298.82
5.1.60.0060.0328.10
5.1.50.0050.0258.09
5.1.40.0050.0258.08
5.1.30.0040.0278.43
5.1.20.0050.0278.45
5.1.10.0060.0288.18
5.1.00.0060.0378.18
5.0.50.0050.0246.66
5.0.40.0070.0166.52
5.0.30.0030.0336.33
5.0.20.0050.0196.30
5.0.10.0050.0266.28
5.0.00.0050.0346.27
4.4.90.0040.0154.78
4.4.80.0040.0164.75
4.4.70.0030.0234.75
4.4.60.0030.0184.75
4.4.50.0020.0164.77
4.4.40.0030.0274.71
4.4.30.0050.0204.75
4.4.20.0050.0204.85
4.4.10.0070.0184.85
4.4.00.0010.0294.76
4.3.110.0030.0164.67
4.3.100.0040.0174.66
4.3.90.0040.0144.64
4.3.80.0050.0224.58
4.3.70.0030.0154.63
4.3.60.0040.0154.63
4.3.50.0020.0164.63
4.3.40.0030.0244.54
4.3.30.0030.0153.33
4.3.20.0010.0183.31
4.3.10.0030.0153.27
4.3.00.0070.02019.45

preferences:
53.27 ms | 401 KiB | 5 Q