3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class a { private $foo = 'private'; public function printFoo() { var_dump($this->foo); } } class b extends a { public function doIt() { $this->foo = 'set from B'; } } $b = new b(); $b->doIt(); $b->printFoo(); var_dump($b->foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RJsbR
function name:  (null)
number of ops:  12
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_METHOD_CALL                                         !0, 'doIt'
          4        DO_FCALL                                      0          
   19     5        INIT_METHOD_CALL                                         !0, 'printFoo'
          6        DO_FCALL                                      0          
   20     7        INIT_FCALL                                               'var_dump'
          8        FETCH_OBJ_R                                      ~6      !0, 'foo'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class a:
Function printfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RJsbR
function name:  printFoo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'foo'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    8     4      > RETURN                                                   null

End of function printfoo

End of class a.

Class b:
Function doit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RJsbR
function name:  doIt
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN_OBJ                                               'foo'
          1        OP_DATA                                                  'set+from+B'
   14     2      > RETURN                                                   null

End of function doit

Function printfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RJsbR
function name:  printFoo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'foo'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    8     4      > RETURN                                                   null

End of function printfoo

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.04 ms | 1401 KiB | 15 Q