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] ]; array_multisort( array_map(fn($obj) => $obj->Name !== 'House', $objects), array_column($objects, 'Total'), SORT_DESC, $objects ); var_export($objects);
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
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, ), )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
148.1 ms | 408 KiB | 5 Q