3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bar { public function setup_pins() { for ($i = 0; $i < 4; $i++) { echo "Setting up pin " . $i . "\n"; $this->pin[$i] = new Pin; $this->pin[$i]->setup_unit(4, array()); } } } class Pin { public function setup_unit($pin_no, $units) { $this->do_counter(); echo $this->c; } public function do_counter() { if (! isset($this->c)) { $this->c = 0; echo "Not set\n"; } else { $this->c++; echo "C is " . $this->c . "\n"; } } } $stuff = new bar; $stuff->setup_pins();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E8iRB
function name:  (null)
number of ops:  6
compiled vars:  !0 = $stuff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   NEW                                              $1      'bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   41     3        INIT_METHOD_CALL                                         !0, 'setup_pins'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class bar:
Function setup_pins:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 2
Branch analysis from position: 19
Branch analysis from position: 2
filename:       /in/E8iRB
function name:  setup_pins
number of ops:  20
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->17
    9     2    >   CONCAT                                           ~2      'Setting+up+pin+', !0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
   10     5        NEW                                              $6      'Pin'
          6        DO_FCALL                                      0          
          7        FETCH_OBJ_W                                      $4      'pin'
          8        ASSIGN_DIM                                               $4, !0
          9        OP_DATA                                                  $6
   11    10        FETCH_OBJ_R                                      ~8      'pin'
         11        FETCH_DIM_R                                      ~9      ~8, !0
         12        INIT_METHOD_CALL                                         ~9, 'setup_unit'
         13        SEND_VAL_EX                                              4
         14        SEND_VAL_EX                                              <array>
         15        DO_FCALL                                      0          
    7    16        PRE_INC                                                  !0
         17    >   IS_SMALLER                                               !0, 4
         18      > JMPNZ                                                    ~12, ->2
   13    19    > > RETURN                                                   null

End of function setup_pins

End of class bar.

Class Pin:
Function setup_unit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E8iRB
function name:  setup_unit
number of ops:  7
compiled vars:  !0 = $pin_no, !1 = $units
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2        INIT_METHOD_CALL                                         'do_counter'
          3        DO_FCALL                                      0          
   21     4        FETCH_OBJ_R                                      ~3      'c'
          5        ECHO                                                     ~3
   22     6      > RETURN                                                   null

End of function setup_unit

Function do_counter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E8iRB
function name:  do_counter
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ISSET_ISEMPTY_PROP_OBJ                           ~0      'c'
          1        BOOL_NOT                                         ~1      ~0
          2      > JMPZ                                                     ~1, ->7
   28     3    >   ASSIGN_OBJ                                               'c'
          4        OP_DATA                                                  0
   29     5        ECHO                                                     'Not+set%0A'
          6      > JMP                                                      ->12
   33     7    >   PRE_INC_OBJ                                              'c'
   34     8        FETCH_OBJ_R                                      ~4      'c'
          9        CONCAT                                           ~5      'C+is+', ~4
         10        CONCAT                                           ~6      ~5, '%0A'
         11        ECHO                                                     ~6
   36    12    > > RETURN                                                   null

End of function do_counter

End of class Pin.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.74 ms | 1399 KiB | 13 Q