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

End of function __construct

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.54 ms | 1400 KiB | 15 Q