3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function getStuff() { return "stuff"; } } class Bar extends Foo { public function getStuff() { return strtoupper($this->getOtherStuff()); } public function getOtherStuff() { return parent::getStuff(); } } $foo = new Foo(); $bar = new Bar(); var_dump($foo->getStuff()); var_dump($bar->getStuff());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OOr7X
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        NEW                                              $5      'Bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   26     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'getStuff'
          8        DO_FCALL                                      0  $8      
          9        SEND_VAR                                                 $8
         10        DO_ICALL                                                 
   27    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !1, 'getStuff'
         13        DO_FCALL                                      0  $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Foo:
Function getstuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OOr7X
function name:  getStuff
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'stuff'
    8     1*     > RETURN                                                   null

End of function getstuff

End of class Foo.

Class Bar:
Function getstuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OOr7X
function name:  getStuff
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'strtoupper'
          1        INIT_METHOD_CALL                                         'getOtherStuff'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   16     6*     > RETURN                                                   null

End of function getstuff

Function getotherstuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OOr7X
function name:  getOtherStuff
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                  'getStuff'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   21     3*     > RETURN                                                   null

End of function getotherstuff

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.68 ms | 1400 KiB | 17 Q