3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = array(); $myArray[]['username'] = 'cpranot'; $myArray[]['username'] = 'lcruz'; $myArray[]['username'] = 'adlee'; //usort($myArray, function($a, $b) { return strnatcmp($a["username"], $b["username"]); }); function something($a, $b){return strnatcmp($a["username"], $b["username"]);} usort($myArray, 'something'); var_dump($myArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lb1gD
function name:  (null)
number of ops:  18
compiled vars:  !0 = $myArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        FETCH_DIM_W                                      $2      !0
          2        ASSIGN_DIM                                               $2, 'username'
          3        OP_DATA                                                  'cpranot'
    4     4        FETCH_DIM_W                                      $4      !0
          5        ASSIGN_DIM                                               $4, 'username'
          6        OP_DATA                                                  'lcruz'
    5     7        FETCH_DIM_W                                      $6      !0
          8        ASSIGN_DIM                                               $6, 'username'
          9        OP_DATA                                                  'adlee'
   11    10        INIT_FCALL                                               'usort'
         11        SEND_REF                                                 !0
         12        SEND_VAL                                                 'something'
         13        DO_ICALL                                                 
   14    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lb1gD
function name:  something
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'strnatcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'username'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'username'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
          9*     > RETURN                                                   null

End of function something

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.72 ms | 1396 KiB | 19 Q