3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'name' => 'Foo', 'children' => [ 'B', 'A', ], ], [ 'name' => 'Bar', 'children' => [ 'Z', 'X', 'Y', ], ], ]; usort($array, function (&$x, &$y) { sort($x['children']); sort($y['children']); return strcasecmp($x['name'], $y['name']); }); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0FPFQ
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>
   21     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0FPFQ%3A21%240'
   26     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   28     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F0FPFQ%3A21%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.35 ms | 1388 KiB | 21 Q