3v4l.org

run code in 300+ PHP versions simultaneously
<?php $menu = [ (object)[ 'tid' => 24, 'name' => 'Sample', 'weight' => 3, 'depth' => 0 ], (object)[ 'tid' => 66, 'name' => 'Sample Subcategory', 'weight' => 0, 'depth' => 1 ], (object)[ 'tid' => 67, 'name' => 'Another Example', 'weight' => 1, 'depth' => 0 ], (object)[ 'tid' => 68, 'name' => 'Subcategory for Another Example', 'weight' => 1, 'depth' => 1 ], (object)[ 'tid' => 22, 'name' => 'A third example master category', 'weight' => 0, 'depth' => 0 ] ]; usort($menu, function($a, $b) { return [$a->depth, $a->weight] <=> [$b->depth, $b->weight]; }); var_export($menu);

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.5.20.0110.00619.46
8.5.10.0100.00718.80
8.5.00.0120.00920.11
8.4.170.0130.00823.75
8.4.160.0100.01423.10
8.4.150.0020.00114.05
8.4.140.0150.00717.40
8.4.130.0130.00617.71
8.4.120.0080.00922.23
8.4.110.0050.00720.67
8.4.100.0090.01018.90
8.4.90.0140.00620.42
8.4.80.0070.00918.85
8.4.70.0130.00718.06
8.4.60.0130.00919.16
8.4.50.0120.00818.41
8.4.40.0030.00619.44
8.4.30.0060.00320.43
8.4.20.0040.01520.50
8.4.10.0100.01019.50
8.3.300.0120.00920.92
8.3.290.0130.01122.66
8.3.280.0100.01018.46
8.3.270.0100.01116.62
8.3.260.0140.00616.66
8.3.250.0070.01119.00
8.3.240.0090.00917.03
8.3.230.0150.00516.84
8.3.220.0090.00718.85
8.3.210.0100.00816.74
8.3.200.0050.00416.52
8.3.190.0130.00316.97
8.3.180.0010.00817.19
8.3.170.0160.00319.05
8.3.160.0110.00420.06
8.3.150.0000.01817.17
8.3.140.0050.00317.03
8.3.130.0050.00318.46
8.3.120.0120.00920.58
8.3.110.0030.00720.94
8.3.100.0040.00416.41
8.3.90.0090.00016.52
8.3.80.0000.01119.36
8.3.70.0070.00716.38
8.3.60.0030.01416.50
8.3.50.0070.00823.63
8.3.40.0100.00718.67
8.3.30.0070.00718.67
8.3.20.0040.00420.90
8.3.10.0030.00523.53
8.3.00.0040.00421.85
8.2.300.0100.00918.19
8.2.290.0130.00520.48
8.2.280.0110.00918.24
8.2.270.0040.00419.12
8.2.260.0080.00816.71
8.2.250.0080.00018.39
8.2.240.0030.00619.16
8.2.230.0030.00522.58
8.2.220.0030.00624.06
8.2.210.0040.00426.77
8.2.200.0040.00418.88
8.2.190.0120.00918.29
8.2.180.0130.00316.50
8.2.170.0110.00322.96
8.2.160.0030.01221.99
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0000.00819.61
8.2.110.0030.00719.19
8.2.100.0090.00318.03
8.2.90.0070.00018.28
8.2.80.0060.00319.11
8.2.70.0000.00818.04
8.2.60.0080.00318.22
8.2.50.0000.00818.10
8.2.40.0040.00421.14
8.2.30.0030.00519.23
8.2.20.0040.00418.13
8.2.10.0000.00719.26
8.2.00.0040.00419.20
8.1.340.0110.01117.54
8.1.330.0060.00321.85
8.1.320.0120.00617.88
8.1.310.0070.00718.57
8.1.300.0150.00417.98
8.1.290.0030.00630.84
8.1.280.0120.00625.92
8.1.270.0060.00320.69
8.1.260.0050.00326.35
8.1.250.0050.00228.09
8.1.240.0090.00022.15
8.1.230.0080.00320.91
8.1.220.0080.00017.74
8.1.210.0040.00418.98
8.1.200.0000.00917.35
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0060.00318.65
8.1.160.0040.00420.59
8.1.150.0030.00518.54
8.1.140.0040.00420.80
8.1.130.0050.00320.20
8.1.120.0040.00417.39
8.1.110.0000.00717.44
8.1.100.0030.00517.46
8.1.90.0000.00817.51
8.1.80.0000.00717.39
8.1.70.0000.00717.47
8.1.60.0080.00017.61
8.1.50.0040.00417.58
8.1.40.0000.00817.51
8.1.30.0050.00317.66
8.1.20.0030.00617.68
8.1.10.0050.00317.60
8.1.00.0040.00417.46
8.0.300.0040.00420.13
8.0.290.0040.00416.63
8.0.280.0000.00718.38
8.0.270.0000.00718.07
8.0.260.0000.00619.93
8.0.250.0030.00316.92
8.0.240.0000.00716.87
8.0.230.0000.00717.06
8.0.220.0080.00016.95
8.0.210.0000.00716.92
8.0.200.0000.00616.88
8.0.190.0000.00717.04
8.0.180.0000.00917.02
8.0.170.0060.00416.97
8.0.160.0000.00716.85
8.0.150.0040.00416.79
8.0.140.0030.00416.93
8.0.130.0070.00013.35
8.0.120.0050.00216.93
8.0.110.0040.00416.83
8.0.100.0040.00416.91
8.0.90.0090.00016.86
8.0.80.0030.01316.90
8.0.70.0000.00716.99
8.0.60.0040.00416.84
8.0.50.0000.00717.00
8.0.30.0030.01417.33
8.0.20.0070.02017.13
8.0.10.0050.00217.13
8.0.00.0120.00616.60
7.4.330.0050.00016.71
7.4.320.0040.00416.60
7.4.300.0000.00716.50
7.4.290.0030.00316.61
7.4.280.0060.00316.55
7.4.270.0040.00416.60
7.4.260.0050.00013.20
7.4.250.0050.00316.56
7.4.240.0020.00516.51
7.4.230.0030.00316.61
7.4.220.0020.00616.49
7.4.210.0080.01116.65
7.4.200.0000.00716.39
7.4.130.0090.00916.57
7.4.120.0070.01816.43
7.4.10.0090.01316.53
7.4.00.0130.00716.62
7.3.330.0080.00016.12
7.3.320.0000.00513.29
7.3.310.0000.00816.45
7.3.300.0000.00716.32
7.3.290.0110.00516.29
7.3.280.0030.01316.32
7.3.260.0150.00316.52
7.3.240.0120.00716.35
7.3.130.0060.00916.50
7.3.120.0090.00616.22
7.3.110.0000.01516.06
7.3.100.0090.00616.01
7.3.90.0110.00416.49
7.3.80.0060.01516.40
7.3.70.0110.00816.31
7.3.60.0060.01516.32
7.3.50.0030.01316.13
7.3.40.0180.00016.33
7.3.30.0040.01216.32
7.3.20.0090.01216.24
7.3.10.0100.00716.39
7.3.00.0480.01016.31
7.2.260.0140.00316.78
7.2.250.0100.01316.43
7.2.240.0090.00916.76
7.2.230.0090.01216.30
7.2.220.0000.02116.63
7.2.210.0080.01216.44
7.2.200.0070.01316.36
7.2.190.0090.01216.48
7.2.180.0000.01616.35
7.2.170.0140.00316.45
7.2.160.0130.00416.59
7.2.150.0120.00616.58
7.2.140.0040.01216.68
7.2.130.0140.00816.60
7.2.120.0030.01916.47
7.2.110.0100.01016.55
7.2.100.0150.00616.68
7.2.90.0090.00916.70
7.2.80.0080.00916.58
7.2.70.0070.01516.78
7.2.60.0100.01316.61
7.2.50.0070.01016.60
7.2.40.0150.00316.65
7.2.30.0090.00616.63
7.2.20.0140.00316.63
7.2.10.0110.00616.80
7.2.00.0100.00616.53

preferences:
163.39 ms | 403 KiB | 5 Q