3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['id' => 15, 'parent' => 12], ['id' => 10, 'parent' => 12], ['id' => 12, 'parent' => 12], ['id' => 17, 'parent' => 12], ['id' => 21, 'parent' => 15], ['id' => 13, 'parent' => 15], ['id' => 15, 'parent' => 15], ['id' => 25, 'parent' => 15], ['id' => 7, 'parent' => 7], ['id' => 18, 'parent' => 7], ['id' => 4, 'parent' => 7], ['id' => 1, 'parent' => 3], ['id' => 5, 'parent' => 5], ['id' => 2, 'parent' => 7], ]; usort( $array, fn($a, $b) => [$a['parent'], $a['id'] !== $a['parent'], $a['id']] <=> [$b['parent'], $b['id'] !== $b['parent'], $b['id']] ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DJCV3
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        INIT_FCALL                                               'usort'
   21     2        SEND_REF                                                 !0
   22     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   26     4        SEND_VAL                                                 ~2
   20     5        DO_ICALL                                                 
   27     6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > 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/DJCV3
function name:  {closure}
number of ops:  21
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        FETCH_DIM_R                                      ~2      !0, 'parent'
          3        INIT_ARRAY                                       ~3      ~2
          4        FETCH_DIM_R                                      ~4      !0, 'id'
          5        FETCH_DIM_R                                      ~5      !0, 'parent'
          6        IS_NOT_IDENTICAL                                 ~6      ~4, ~5
          7        ADD_ARRAY_ELEMENT                                ~3      ~6
          8        FETCH_DIM_R                                      ~7      !0, 'id'
          9        ADD_ARRAY_ELEMENT                                ~3      ~7
   25    10        FETCH_DIM_R                                      ~8      !1, 'parent'
         11        INIT_ARRAY                                       ~9      ~8
         12        FETCH_DIM_R                                      ~10     !1, 'id'
         13        FETCH_DIM_R                                      ~11     !1, 'parent'
         14        IS_NOT_IDENTICAL                                 ~12     ~10, ~11
         15        ADD_ARRAY_ELEMENT                                ~9      ~12
         16        FETCH_DIM_R                                      ~13     !1, 'id'
         17        ADD_ARRAY_ELEMENT                                ~9      ~13
         18        SPACESHIP                                        ~14     ~3, ~9
         19      > RETURN                                                   ~14
   26    20*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.91 ms | 1000 KiB | 15 Q