3v4l.org

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

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

End of function whoami

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
359.75 ms | 1397 KiB | 14 Q