3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { private $a = [ 'foo-test' => [1], '-' => [2], 'bar-test' => [3] ]; private function _mySort($x, $y) { print_r($this->a); var_dump($x); var_dump($x == 'foo-test' || $x == '-' || $x == 'bar-test'); if (!isset($this->a[$x])) { throw new Exception('Missing X: "' . $x . '"'); } if (!isset($this->a[$y])) { throw new Exception('Missing Y: "' . $y . '"'); } return ($x < $y ? -1 : ($x > $y ? 1 : 0)); } public function __construct() { uksort($this->a, [$this, '_mySort']); } } new myClass();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/faOWb
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $0      'myClass'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Class myClass:
Function _mysort:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 29
Branch analysis from position: 23
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 14
filename:       /in/faOWb
function name:  _mySort
number of ops:  51
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        INIT_FCALL                                               'print_r'
          3        FETCH_OBJ_R                                      ~2      'a'
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   14     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   15     9        INIT_FCALL                                               'var_dump'
         10        IS_EQUAL                                         ~5      !0, 'foo-test'
         11      > JMPNZ_EX                                         ~5      ~5, ->14
         12    >   IS_EQUAL                                         ~6      !0, '-'
         13        BOOL                                             ~5      ~6
         14    > > JMPNZ_EX                                         ~5      ~5, ->17
         15    >   IS_EQUAL                                         ~7      !0, 'bar-test'
         16        BOOL                                             ~5      ~7
         17    >   SEND_VAL                                                 ~5
         18        DO_ICALL                                                 
   16    19        FETCH_OBJ_IS                                     ~9      'a'
         20        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     ~9, !0
         21        BOOL_NOT                                         ~11     ~10
         22      > JMPZ                                                     ~11, ->29
   17    23    >   NEW                                              $12     'Exception'
         24        CONCAT                                           ~13     'Missing+X%3A+%22', !0
         25        CONCAT                                           ~14     ~13, '%22'
         26        SEND_VAL_EX                                              ~14
         27        DO_FCALL                                      0          
         28      > THROW                                         0          $12
   20    29    >   FETCH_OBJ_IS                                     ~16     'a'
         30        ISSET_ISEMPTY_DIM_OBJ                         0  ~17     ~16, !1
         31        BOOL_NOT                                         ~18     ~17
         32      > JMPZ                                                     ~18, ->39
   21    33    >   NEW                                              $19     'Exception'
         34        CONCAT                                           ~20     'Missing+Y%3A+%22', !1
         35        CONCAT                                           ~21     ~20, '%22'
         36        SEND_VAL_EX                                              ~21
         37        DO_FCALL                                      0          
         38      > THROW                                         0          $19
   24    39    >   IS_SMALLER                                               !0, !1
         40      > JMPZ                                                     ~23, ->43
         41    >   QM_ASSIGN                                        ~24     -1
         42      > JMP                                                      ->49
         43    >   IS_SMALLER                                               !1, !0
         44      > JMPZ                                                     ~25, ->47
         45    >   QM_ASSIGN                                        ~26     1
         46      > JMP                                                      ->48
         47    >   QM_ASSIGN                                        ~26     0
         48    >   QM_ASSIGN                                        ~24     ~26
         49    > > RETURN                                                   ~24
   25    50*     > RETURN                                                   null

End of function _mysort

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/faOWb
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'uksort'
          1        FETCH_OBJ_W                                      $0      'a'
          2        SEND_REF                                                 $0
          3        FETCH_THIS                                       ~1      
          4        INIT_ARRAY                                       ~2      ~1
          5        ADD_ARRAY_ELEMENT                                ~2      '_mySort'
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   30     8      > RETURN                                                   null

End of function __construct

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.65 ms | 1400 KiB | 19 Q