3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $foo = 'bar'; public function getFoo() { print $this->foo; return; } } class Bar extends Foo { } $f = new Foo(); $f->getFoo(); $b = new Bar(); $b->getFoo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZB0Gm
function name:  (null)
number of ops:  11
compiled vars:  !0 = $f, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        INIT_METHOD_CALL                                         !0, 'getFoo'
          4        DO_FCALL                                      0          
   19     5        NEW                                              $6      'Bar'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   20     8        INIT_METHOD_CALL                                         !1, 'getFoo'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class Foo:
Function getfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZB0Gm
function name:  getFoo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'foo'
          1        ECHO                                                     ~0
    8     2      > RETURN                                                   null
    9     3*     > RETURN                                                   null

End of function getfoo

End of class Foo.

Class Bar:
Function getfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZB0Gm
function name:  getFoo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'foo'
          1        ECHO                                                     ~0
    8     2      > RETURN                                                   null
    9     3*     > RETURN                                                   null

End of function getfoo

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.47 ms | 1398 KiB | 13 Q