3v4l.org

run code in 300+ PHP versions simultaneously
<?php $objects = [ (object)['Leasing' => 12939.74, 'Name' => 'Jeremy', 'Rental' => 0, 'Sales' => 56603.13, 'Total' => 69542.87], (object)['Leasing' => 0, 'Name' => 'Shaun', 'Rental' => 0, 'Sales' => 58590, 'Total' => 58590], (object)['Leasing' => 0, 'Name' => 'Lindsay', 'Rental' => 0, 'Sales' => 22951.97, 'Total' => 22951.97], (object)['Leasing' => 0, 'Name' => 'Sally', 'Rental' => 1200, 'Sales' => 21624.9, 'Total' => 22824.9], (object)['Leasing' => 0, 'Name' => 'House', 'Rental' => 0, 'Sales' => 16235.81, 'Total' => 16235.81], (object)['Leasing' => 5298.85, 'Name' => 'Bill', 'Rental' => 1200, 'Sales' => 0, 'Total' => 6498.85] ]; usort($objects, function($a, $b) { return [$b->Name === 'House', $b->Total] <=> [$a->Name === 'House', $a->Total]; }); var_export($objects);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => (object) array( 'Leasing' => 0, 'Name' => 'House', 'Rental' => 0, 'Sales' => 16235.81, 'Total' => 16235.81, ), 1 => (object) array( 'Leasing' => 12939.74, 'Name' => 'Jeremy', 'Rental' => 0, 'Sales' => 56603.13, 'Total' => 69542.87, ), 2 => (object) array( 'Leasing' => 0, 'Name' => 'Shaun', 'Rental' => 0, 'Sales' => 58590, 'Total' => 58590, ), 3 => (object) array( 'Leasing' => 0, 'Name' => 'Lindsay', 'Rental' => 0, 'Sales' => 22951.97, 'Total' => 22951.97, ), 4 => (object) array( 'Leasing' => 0, 'Name' => 'Sally', 'Rental' => 1200, 'Sales' => 21624.9, 'Total' => 22824.9, ), 5 => (object) array( 'Leasing' => 5298.85, 'Name' => 'Bill', 'Rental' => 1200, 'Sales' => 0, 'Total' => 6498.85, ), )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
75.3 ms | 408 KiB | 5 Q