3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Products { public static function sortByPriceAscending($jsonString) { $info = json_decode($jsonString, true); print_r($info); usort($info, function($a, $b) { return $a['price'] - $b['price']; }); print_r($info); } } // For testing purposes (do not submit uncommented) echo Products::sortByPriceAscending('[{"name":"coffee","price":9.99},{"name":"eggs","price":1},{"name":"rice","price":4.04}]');

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.4.20.0170.00319.70
8.4.10.0120.00919.57
8.3.150.0110.00717.02
8.3.140.0000.00816.98
8.3.130.0060.00318.60
8.3.120.0030.00618.93
8.3.110.0050.00320.94
8.3.100.0090.00024.06
8.3.90.0050.00226.77
8.3.80.0040.00416.50
8.3.70.0180.00016.36
8.3.60.0150.00616.63
8.3.50.0140.00521.15
8.3.40.0070.01018.64
8.3.30.0060.00918.43
8.3.20.0070.00020.19
8.3.10.0050.00320.36
8.3.00.0040.00421.77
8.2.270.0110.00717.07
8.2.260.0070.00017.25
8.2.250.0120.00616.83
8.2.240.0000.00817.18
8.2.230.0080.00022.58
8.2.220.0100.00037.54
8.2.210.0040.01626.77
8.2.200.0000.01216.50
8.2.190.0140.00316.58
8.2.180.0070.00717.00
8.2.170.0090.00922.96
8.2.160.0070.00719.47
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0000.00822.04
8.2.120.0070.00026.35
8.2.110.0060.00320.81
8.2.100.0000.01117.91
8.2.90.0030.00617.89
8.2.80.0040.00418.05
8.2.70.0040.00418.05
8.2.60.0000.00718.16
8.2.50.0080.00018.10
8.2.40.0030.00522.23
8.2.30.0000.00719.32
8.2.20.0040.00418.07
8.2.10.0000.00818.12
8.2.00.0050.00217.63
8.1.310.0040.00418.34
8.1.300.0000.01117.85
8.1.290.0090.00018.88
8.1.280.0110.00425.92
8.1.270.0040.00423.83
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0070.00322.17
8.1.230.0030.00922.73
8.1.220.0100.00017.77
8.1.210.0000.00918.77
8.1.200.0030.00717.22
8.1.190.0030.00517.22
8.1.180.0030.00618.10
8.1.170.0040.00418.46
8.1.160.0070.00022.06
8.1.150.0040.00418.80
8.1.140.0040.00419.49
8.1.130.0000.00717.59
8.1.120.0040.00417.48
8.1.110.0050.00217.42
8.1.100.0000.00817.30
8.1.90.0030.00617.44
8.1.80.0070.00017.55
8.1.70.0040.00417.35
8.1.60.0040.00417.61
8.1.50.0000.00817.45
8.1.40.0030.00617.54
8.1.30.0030.00517.67
8.1.20.0000.00717.73
8.1.10.0040.00417.55
8.1.00.0050.00317.50
8.0.300.0040.00420.09
8.0.290.0030.00516.63
8.0.280.0000.00718.48
8.0.270.0030.00617.13
8.0.260.0040.00417.35
8.0.250.0040.00417.00
8.0.240.0050.00516.77
8.0.230.0050.00316.91
8.0.220.0030.00316.74
8.0.210.0060.00016.77
8.0.200.0030.00316.93
8.0.190.0040.00416.96
8.0.180.0070.00016.97
8.0.170.0070.00016.89
8.0.160.0030.00316.79
8.0.150.0000.00916.75
8.0.140.0040.00416.75
8.0.130.0030.00313.40
8.0.120.0000.00816.82
8.0.110.0040.00416.85
8.0.100.0050.00316.76
8.0.90.0000.00816.75
8.0.80.0110.00516.89
8.0.70.0000.00916.89
8.0.60.0000.00716.94
8.0.50.0040.00416.76
8.0.30.0080.01217.07
8.0.20.0140.00817.40
8.0.10.0070.00016.81
8.0.00.0130.00716.86
7.4.330.0000.00515.08
7.4.320.0000.00616.52
7.4.300.0060.00016.51
7.4.290.0030.00316.60
7.4.280.0100.00016.46
7.4.270.0040.00416.61
7.4.260.0070.00016.58
7.4.250.0000.00716.57
7.4.240.0040.00416.55
7.4.230.0000.00716.51
7.4.220.0110.00716.52
7.4.210.0050.01016.56
7.4.200.0080.00016.42
7.4.160.0130.00516.61
7.4.150.0070.01017.40
7.4.140.0170.00717.86
7.4.130.0120.00616.51
7.4.120.0140.00516.57
7.4.110.0130.01016.51
7.4.100.0030.01316.46
7.4.90.0000.02216.52
7.4.80.0030.01419.39
7.4.70.0110.00616.53
7.4.60.0100.00616.56
7.4.50.0100.00716.23
7.4.40.0000.01616.69
7.4.30.0030.01316.59
7.4.10.0110.00715.10
7.4.00.0030.01214.98
7.3.330.0030.00213.34
7.3.320.0030.00313.44
7.3.310.0000.00716.18
7.3.300.0070.00016.39
7.3.290.0070.00016.18
7.3.280.0050.01416.32
7.3.270.0140.00317.40
7.3.260.0120.00816.46
7.3.250.0150.00416.35
7.3.240.0110.00616.53
7.3.230.0040.01116.39
7.3.210.0090.00916.43
7.3.200.0080.00816.61
7.3.190.0000.01716.45
7.3.180.0040.01216.40
7.3.170.0080.01116.31
7.3.160.0080.00916.28
7.3.130.0030.01314.86
7.3.120.0090.00614.92
7.3.110.0000.01315.08
7.3.100.0070.00715.02
7.3.90.0070.01114.77
7.3.80.0060.00614.84
7.3.70.0030.00914.64
7.3.60.0030.01014.91
7.3.50.0060.00315.05
7.3.40.0030.01014.69
7.3.30.0090.00014.62
7.3.20.0030.00616.55
7.3.10.0040.01016.40
7.3.00.0090.00716.57
7.2.330.0130.00616.45
7.2.320.0130.00316.49
7.2.310.0080.00816.48
7.2.300.0070.01416.81
7.2.290.0130.01016.64
7.2.260.0100.00615.28
7.2.250.0070.01015.07
7.2.240.0090.00615.01
7.2.230.0000.01515.04
7.2.220.0070.00715.23
7.2.210.0070.00715.16
7.2.200.0070.00715.02
7.2.190.0000.00914.71
7.2.180.0050.00515.20
7.2.170.0040.01115.21
7.2.160.0090.00614.77
7.2.150.0060.01016.97
7.2.140.0100.00716.93
7.2.130.0030.00916.76
7.2.120.0050.01016.90
7.2.110.0070.00516.85
7.2.100.0090.00416.88
7.2.90.0050.01116.92
7.2.80.0080.00816.88
7.2.70.0100.01016.92
7.2.60.0060.01016.74
7.2.50.0060.00816.88
7.2.40.0070.00816.88
7.2.30.0080.00716.94
7.2.20.0100.00717.00
7.2.10.0100.00516.86
7.2.00.0080.00917.71
7.1.330.0130.00315.80
7.1.320.0030.00615.72
7.1.310.0030.01016.04
7.1.300.0040.01115.73
7.1.290.0000.00815.56
7.1.280.0030.01015.66
7.1.270.0080.00016.00
7.1.260.0100.00615.76
7.1.250.0070.00515.62
7.1.240.0040.00715.84
7.1.230.0030.00915.64
7.1.220.0030.00615.58
7.1.210.0080.00615.90
7.1.200.0060.00715.82
7.1.190.0000.01215.89
7.1.180.0060.00615.81
7.1.170.0030.01015.74
7.1.160.0090.00615.78
7.1.150.0070.00715.88
7.1.140.0120.00615.80
7.1.130.0120.00316.02
7.1.120.0030.01315.86
7.1.110.0040.00815.96
7.1.100.0030.01015.79
7.1.90.0030.01115.63
7.1.80.0030.01015.99
7.1.70.0030.00516.45
7.1.60.0030.00716.66
7.1.50.0060.00615.85
7.1.40.0070.00716.01
7.1.30.0030.00915.59
7.1.20.0150.00015.75
7.1.10.0060.00315.62
7.1.00.0030.04219.00
7.0.330.0000.01215.30
7.0.320.0030.01015.46
7.0.310.0040.01115.39
7.0.300.0030.00615.35
7.0.290.0040.00815.48
7.0.280.0090.00615.39
7.0.270.0030.01415.22
7.0.260.0030.01315.34
7.0.250.0100.00315.35
7.0.240.0070.00715.55
7.0.230.0030.00915.46
7.0.220.0110.00415.31
7.0.210.0060.00615.52
7.0.200.0480.00515.00
7.0.190.0070.00415.40
7.0.180.0040.01115.58
7.0.170.0030.01015.37
7.0.160.0130.00315.43
7.0.150.0000.01415.34
7.0.140.0060.00315.46
7.0.130.0080.00615.53
7.0.120.0060.00615.39
7.0.110.1520.03017.82
7.0.100.0020.03717.82
7.0.90.0050.03817.83
7.0.80.0050.03517.79
7.0.70.0170.03117.73
7.0.60.0130.03117.83
7.0.50.0170.03517.93
7.0.40.0150.03216.89
7.0.30.0180.03016.85
7.0.20.0170.03116.86
7.0.10.0210.02316.75
7.0.00.0190.02716.82
5.6.400.0120.00314.47
5.6.390.0000.01414.58
5.6.380.0000.00814.18
5.6.370.0030.01414.61
5.6.360.0030.01014.41
5.6.350.0070.00714.85
5.6.340.0000.01114.43
5.6.330.0110.00714.41
5.6.320.0100.00714.36
5.6.310.0120.00314.32
5.6.300.0100.00614.04
5.6.290.0100.00314.45
5.6.280.0030.00614.50
5.6.270.0000.00914.64
5.6.260.0080.03017.72
5.6.250.0070.03517.73
5.6.240.0060.03317.74
5.6.230.0020.03717.76
5.6.220.0080.03317.60
5.6.210.0090.02817.65
5.6.200.0070.03517.59
5.6.190.0100.03317.61
5.6.180.0070.03217.63
5.6.170.0100.02917.61
5.6.160.0100.02817.70
5.6.150.0080.03217.65
5.6.140.0120.02717.53
5.6.130.0090.03017.85
5.6.120.0080.03317.63
5.6.110.0090.03117.54
5.6.100.0120.03017.55
5.6.90.0150.02517.64
5.6.80.0150.02517.25
5.6.70.0150.02517.21
5.6.60.0030.03517.26
5.6.50.0030.03517.19
5.6.40.0070.03017.30
5.6.30.0130.02517.40
5.6.20.0100.03017.42
5.6.10.0080.03217.14
5.6.00.0050.03117.31

preferences:
32.29 ms | 403 KiB | 5 Q