3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array( 'name' => 'Foo', 'children' => array( 'B', 'A', ), ), array( 'name' => 'Bar', 'children' => array( 'Z', 'X', 'Y', ), ), ); usort($array, function (&$x, &$y) { sort($x['children']); sort($y['children']); $x[] = 'Test'; $x[] = 'Test2'; 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/bT5ru
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%2FbT5ru%3A21%240'
   29     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   31     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FbT5ru%3A21%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bT5ru
function name:  {closure}
number of ops:  22
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        ASSIGN_DIM                                               !0
         11        OP_DATA                                                  'Test'
   26    12        ASSIGN_DIM                                               !0
         13        OP_DATA                                                  'Test2'
   28    14        INIT_FCALL                                               'strcasecmp'
         15        FETCH_DIM_R                                      ~8      !0, 'name'
         16        SEND_VAL                                                 ~8
         17        FETCH_DIM_R                                      ~9      !1, 'name'
         18        SEND_VAL                                                 ~9
         19        DO_ICALL                                         $10     
         20      > RETURN                                                   $10
   29    21*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.01 ms | 1396 KiB | 21 Q