3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function whowasi() { echo __CLASS__; echo get_class($this); } } class bar extends foo { function whoami() { echo __CLASS__; echo get_class($this); } } $bar = new bar(); $bar->whowasi(); $bar->whoami();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HrMup
function name:  (null)
number of ops:  8
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'whowasi'
          4        DO_FCALL                                      0          
   22     5        INIT_METHOD_CALL                                         !0, 'whoami'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function whowasi

End of class foo.

Class bar:
Function whoami:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HrMup
function name:  whoami
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     'bar'
   16     1        FETCH_THIS                                       ~0      
          2        GET_CLASS                                        ~1      ~0
          3        ECHO                                                     ~1
   17     4      > RETURN                                                   null

End of function whoami

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

End of function whowasi

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.87 ms | 1395 KiB | 13 Q