3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public $cache = [ 'a' => -1, 'b' => -1, 'c' => 0, ]; function sort () { uksort($this->cache, function ($a, $b) { var_export(array_keys($this->cache)); return $this->cache[$a] <=> $this->cache[$b]; }); var_export($this->cache); } } $a = new A(); // $a->sort(); $a->cache['d'] = -2; $a->sort();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9VVKU
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   NEW                                                  $1      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   20     3        FETCH_OBJ_W                                          $4      !0, 'cache'
          4        ASSIGN_DIM                                                   $4, 'd'
          5        OP_DATA                                                      -2
   21     6        INIT_METHOD_CALL                                             !0, 'sort'
          7        DO_FCALL                                          0          
          8      > RETURN                                                       1

Class A:
Function sort:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9VVKU
function name:  sort
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'uksort'
          1        FETCH_OBJ_W                                          $0      'cache'
          2        SEND_REF                                                     $0
          3        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
   14     4        SEND_VAL                                                     ~1
   11     5        DO_ICALL                                                     
   15     6        INIT_FCALL                                                   'var_export'
          7        FETCH_OBJ_R                                          ~3      'cache'
          8        SEND_VAL                                                     ~3
          9        DO_ICALL                                                     
   16    10      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9VVKU
function name:  {closure:A::sort():11}
number of ops:  16
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   12     2        INIT_FCALL                                                   'var_export'
          3        INIT_FCALL                                                   'array_keys'
          4        FETCH_OBJ_R                                          ~2      'cache'
          5        SEND_VAL                                                     ~2
          6        DO_ICALL                                             $3      
          7        SEND_VAR                                                     $3
          8        DO_ICALL                                                     
   13     9        FETCH_OBJ_R                                          ~5      'cache'
         10        FETCH_DIM_R                                          ~6      ~5, !0
         11        FETCH_OBJ_R                                          ~7      'cache'
         12        FETCH_DIM_R                                          ~8      ~7, !1
         13        SPACESHIP                                            ~9      ~6, ~8
         14      > RETURN                                                       ~9
   14    15*     > RETURN                                                       null

End of Dynamic Function 0

End of function sort

End of class A.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.93 ms | 501 KiB | 12 Q