3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'name' => 'Foo', 'children' => [ [ 'name' => 'B', 'children' => [] ], [ 'name' => 'A', 'children' => [] ] ] ], [ 'name' => 'Bar', 'children' => [ [ 'name' => 'Z', 'children' => [] ], [ 'name' => 'X', 'children' => [] ], [ 'name' => 'Y', 'children' => [] ] ] ] ]; usort($array, $f = function(&$x, &$y) use (&$f){ usort($x['children'], $f); usort($y['children'], $f); var_dump($x['children'], $array); return strcasecmp($x['name'], $y['name']); });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dDHZ7
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   36     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdDHZ7%3A36%240'
          4        BIND_LEXICAL                                             ~3, !1
          5        ASSIGN                                           ~4      !1, ~3
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   41     8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FdDHZ7%3A36%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dDHZ7
function name:  {closure}
number of ops:  26
compiled vars:  !0 = $x, !1 = $y, !2 = $f, !3 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   37     3        INIT_FCALL                                               'usort'
          4        FETCH_DIM_W                                      $4      !0, 'children'
          5        SEND_REF                                                 $4
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                                 
   38     8        INIT_FCALL                                               'usort'
          9        FETCH_DIM_W                                      $6      !1, 'children'
         10        SEND_REF                                                 $6
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
   39    13        INIT_FCALL                                               'var_dump'
         14        FETCH_DIM_R                                      ~8      !0, 'children'
         15        SEND_VAL                                                 ~8
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
   40    18        INIT_FCALL                                               'strcasecmp'
         19        FETCH_DIM_R                                      ~10     !0, 'name'
         20        SEND_VAL                                                 ~10
         21        FETCH_DIM_R                                      ~11     !1, 'name'
         22        SEND_VAL                                                 ~11
         23        DO_ICALL                                         $12     
         24      > RETURN                                                   $12
   41    25*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FdDHZ7%3A36%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.87 ms | 1396 KiB | 19 Q