3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $prop = 'A::$prop'; public function __construct() { var_dump(get_object_vars($this)); foreach ($this as $name => $prop) { var_dump($name, $prop); } } } class B extends A { protected $prop = 'B::$prop'; } new B;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rCSNe
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'B'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
   20     3      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/rCSNe
function name:  __construct
number of ops:  18
compiled vars:  !0 = $prop, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'get_object_vars'
          2        FETCH_THIS                                       ~2      
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        DO_ICALL                                                 
    9     7        FETCH_THIS                                       ~5      
          8      > FE_RESET_R                                       $6      ~5, ->16
          9    > > FE_FETCH_R                                       ~7      $6, !0, ->16
         10    >   ASSIGN                                                   !1, ~7
   10    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
    9    15      > JMP                                                      ->9
         16    >   FE_FREE                                                  $6
   12    17      > RETURN                                                   null

End of function __construct

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/rCSNe
function name:  __construct
number of ops:  18
compiled vars:  !0 = $prop, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'get_object_vars'
          2        FETCH_THIS                                       ~2      
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        DO_ICALL                                                 
    9     7        FETCH_THIS                                       ~5      
          8      > FE_RESET_R                                       $6      ~5, ->16
          9    > > FE_FETCH_R                                       ~7      $6, !0, ->16
         10    >   ASSIGN                                                   !1, ~7
   10    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
    9    15      > JMP                                                      ->9
         16    >   FE_FREE                                                  $6
   12    17      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.1 ms | 1006 KiB | 15 Q