3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { private $foo = 'bar'; public function getFoo() { return $this->foo;; } } class Bar extends Foo {} class Baz extends Foo { public function getFoo() { $foo = parent::getFoo(); return $foo . 'yay'; } } $f = new Foo(); print $f->getFoo(); $b = new Bar(); print $b->getFoo(); $baz = new Baz(); print $baz->getFoo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/peMiO
function name:  (null)
number of ops:  19
compiled vars:  !0 = $f, !1 = $b, !2 = $baz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   NEW                                                  $3      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
   25     3        INIT_METHOD_CALL                                             !0, 'getFoo'
          4        DO_FCALL                                          0  $6      
          5        ECHO                                                         $6
   27     6        NEW                                                  $7      'Bar'
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !1, $7
   28     9        INIT_METHOD_CALL                                             !1, 'getFoo'
         10        DO_FCALL                                          0  $10     
         11        ECHO                                                         $10
   30    12        NEW                                                  $11     'Baz'
         13        DO_FCALL                                          0          
         14        ASSIGN                                                       !2, $11
   31    15        INIT_METHOD_CALL                                             !2, 'getFoo'
         16        DO_FCALL                                          0  $14     
         17        ECHO                                                         $14
         18      > RETURN                                                       1

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

End of function getfoo

End of class Bar.

Class Baz:
Function getfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/peMiO
function name:  getFoo
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                      'getFoo'
          1        DO_FCALL                                          0  $1      
          2        ASSIGN                                                       !0, $1
   20     3        CONCAT                                               ~3      !0, 'yay'
          4      > RETURN                                                       ~3
   21     5*     > RETURN                                                       null

End of function getfoo

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.35 ms | 2745 KiB | 13 Q