3v4l.org

run code in 300+ PHP versions simultaneously
<?php class base_class { function say_a() { echo "'a' - said the " . __CLASS__ . "<br/>"; } function say_b() { echo "'b' - said the " . get_class($this) . "<br/>"; } } class derived_class extends base_class { function say_a() { parent::say_a(); echo "'a' - said the " . __CLASS__ . "<br/>"; } function say_b() { parent::say_b(); echo "'b' - said the " . get_class($this) . "<br/>"; } } $obj_b = new derived_class(); $obj_b->say_a(); echo "<br/>"; $obj_b->say_b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/stXSp
function name:  (null)
number of ops:  9
compiled vars:  !0 = $obj_b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $1      'derived_class'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   34     3        INIT_METHOD_CALL                                         !0, 'say_a'
          4        DO_FCALL                                      0          
   35     5        ECHO                                                     '%3Cbr%2F%3E'
   36     6        INIT_METHOD_CALL                                         !0, 'say_b'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class base_class:
Function say_a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/stXSp
function name:  say_a
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     '%27a%27+-+said+the+base_class%3Cbr%2F%3E'
    8     1      > RETURN                                                   null

End of function say_a

Function say_b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/stXSp
function name:  say_b
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_THIS                                       ~0      
          1        GET_CLASS                                        ~1      ~0
          2        CONCAT                                           ~2      '%27b%27+-+said+the+', ~1
          3        CONCAT                                           ~3      ~2, '%3Cbr%2F%3E'
          4        ECHO                                                     ~3
   13     5      > RETURN                                                   null

End of function say_b

End of class base_class.

Class derived_class:
Function say_a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/stXSp
function name:  say_a
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'say_a'
          1        DO_FCALL                                      0          
   22     2        ECHO                                                     '%27a%27+-+said+the+derived_class%3Cbr%2F%3E'
   23     3      > RETURN                                                   null

End of function say_a

Function say_b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/stXSp
function name:  say_b
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_STATIC_METHOD_CALL                                  'say_b'
          1        DO_FCALL                                      0          
   28     2        FETCH_THIS                                       ~1      
          3        GET_CLASS                                        ~2      ~1
          4        CONCAT                                           ~3      '%27b%27+-+said+the+', ~2
          5        CONCAT                                           ~4      ~3, '%3Cbr%2F%3E'
          6        ECHO                                                     ~4
   29     7      > RETURN                                                   null

End of function say_b

End of class derived_class.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.81 ms | 1399 KiB | 13 Q