3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Grandpa { public function test() { echo 'Grandpa test' . PHP_EOL; } } class Papa extends Grandpa { public function test() { echo 'Papa test before' . PHP_EOL; parent::test(); echo 'Papa test after' . PHP_EOL; } } class Kiddo extends Papa { public function test() { echo 'Kiddo test before' . PHP_EOL; parent::parent::test(); echo 'Kiddo test after' . PHP_EOL; } } (new Kiddo())->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/22YAQ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $0      'Kiddo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'test'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class Grandpa:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/22YAQ
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'Grandpa+test%0A'
    8     1      > RETURN                                                   null

End of function test

End of class Grandpa.

Class Papa:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/22YAQ
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'Papa+test+before%0A'
   17     1        INIT_STATIC_METHOD_CALL                                  'test'
          2        DO_FCALL                                      0          
   18     3        ECHO                                                     'Papa+test+after%0A'
   19     4      > RETURN                                                   null

End of function test

End of class Papa.

Class Kiddo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/22YAQ
function name:  test
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ECHO                                                     'Kiddo+test+before%0A'
   27     1        FETCH_CLASS_CONSTANT                             ~0      'parent'
          2        FETCH_CLASS                                   0  $1      ~0
          3        INIT_STATIC_METHOD_CALL                                  $1, 'test'
          4        DO_FCALL                                      0          
   28     5        ECHO                                                     'Kiddo+test+after%0A'
   29     6      > RETURN                                                   null

End of function test

End of class Kiddo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.86 ms | 1395 KiB | 13 Q