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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D2uWq
function name:  (null)
number of ops:  22
compiled vars:  !0 = $objects
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~1      <array>
          1        INIT_ARRAY                                       ~2      ~1
    5     2        CAST                                          8  ~3      <array>
          3        ADD_ARRAY_ELEMENT                                ~2      ~3
    6     4        CAST                                          8  ~4      <array>
          5        ADD_ARRAY_ELEMENT                                ~2      ~4
    7     6        CAST                                          8  ~5      <array>
          7        ADD_ARRAY_ELEMENT                                ~2      ~5
    8     8        CAST                                          8  ~6      <array>
          9        ADD_ARRAY_ELEMENT                                ~2      ~6
    9    10        CAST                                          8  ~7      <array>
         11        ADD_ARRAY_ELEMENT                                ~2      ~7
    3    12        ASSIGN                                                   !0, ~2
   12    13        INIT_FCALL                                               'usort'
         14        SEND_REF                                                 !0
         15        DECLARE_LAMBDA_FUNCTION                          ~9      [0]
   14    16        SEND_VAL                                                 ~9
   12    17        DO_ICALL                                                 
   16    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D2uWq
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        FETCH_OBJ_R                                      ~2      !1, 'Name'
          3        IS_IDENTICAL                                     ~3      ~2, 'House'
          4        INIT_ARRAY                                       ~4      ~3
          5        FETCH_OBJ_R                                      ~5      !1, 'Total'
          6        ADD_ARRAY_ELEMENT                                ~4      ~5
          7        FETCH_OBJ_R                                      ~6      !0, 'Name'
          8        IS_IDENTICAL                                     ~7      ~6, 'House'
          9        INIT_ARRAY                                       ~8      ~7
         10        FETCH_OBJ_R                                      ~9      !0, 'Total'
         11        ADD_ARRAY_ELEMENT                                ~8      ~9
         12        SPACESHIP                                        ~10     ~4, ~8
         13      > RETURN                                                   ~10
   14    14*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.78 ms | 1000 KiB | 15 Q