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) { 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/LjhEX
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   NEW                                                  $1      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   18     3        INIT_METHOD_CALL                                             !0, 'sort'
          4        DO_FCALL                                          0          
   19     5        FETCH_OBJ_W                                          $5      !0, 'cache'
          6        ASSIGN_DIM                                                   $5, 'd'
          7        OP_DATA                                                      -2
   20     8        INIT_METHOD_CALL                                             !0, 'sort'
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

Class A:
Function sort:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LjhEX
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]
   13     4        SEND_VAL                                                     ~1
   11     5        DO_ICALL                                                     
   14     6        INIT_FCALL                                                   'var_export'
          7        FETCH_OBJ_R                                          ~3      'cache'
          8        SEND_VAL                                                     ~3
          9        DO_ICALL                                                     
   15    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/LjhEX
function name:  {closure:A::sort():11}
number of ops:  9
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        FETCH_OBJ_R                                          ~2      'cache'
          3        FETCH_DIM_R                                          ~3      ~2, !0
          4        FETCH_OBJ_R                                          ~4      'cache'
          5        FETCH_DIM_R                                          ~5      ~4, !1
          6        SPACESHIP                                            ~6      ~3, ~5
          7      > RETURN                                                       ~6
   13     8*     > 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:
154.26 ms | 495 KiB | 11 Q