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); 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/MBBaP
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     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 = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MBBaP
function name:  _mySort
number of ops:  38
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        FETCH_OBJ_IS                                     ~4      'a'
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      ~4, !0
          8        BOOL_NOT                                         ~6      ~5
          9      > JMPZ                                                     ~6, ->16
   15    10    >   NEW                                              $7      'Exception'
         11        CONCAT                                           ~8      'Missing+X%3A+%22', !0
         12        CONCAT                                           ~9      ~8, '%22'
         13        SEND_VAL_EX                                              ~9
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $7
   18    16    >   FETCH_OBJ_IS                                     ~11     'a'
         17        ISSET_ISEMPTY_DIM_OBJ                         0  ~12     ~11, !1
         18        BOOL_NOT                                         ~13     ~12
         19      > JMPZ                                                     ~13, ->26
   19    20    >   NEW                                              $14     'Exception'
         21        CONCAT                                           ~15     'Missing+Y%3A+%22', !1
         22        CONCAT                                           ~16     ~15, '%22'
         23        SEND_VAL_EX                                              ~16
         24        DO_FCALL                                      0          
         25      > THROW                                         0          $14
   22    26    >   IS_SMALLER                                               !0, !1
         27      > JMPZ                                                     ~18, ->30
         28    >   QM_ASSIGN                                        ~19     -1
         29      > JMP                                                      ->36
         30    >   IS_SMALLER                                               !1, !0
         31      > JMPZ                                                     ~20, ->34
         32    >   QM_ASSIGN                                        ~21     1
         33      > JMP                                                      ->35
         34    >   QM_ASSIGN                                        ~21     0
         35    >   QM_ASSIGN                                        ~19     ~21
         36    > > RETURN                                                   ~19
   23    37*     > 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/MBBaP
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     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                                                 
   28     8      > RETURN                                                   null

End of function __construct

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.8 ms | 1400 KiB | 17 Q