3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function something() { echo __CLASS__; // foo var_dump($this); } } class foo_bar extends foo { public function something() { echo __CLASS__; // foo_bar var_dump($this); } } class foo_bar_baz extends foo_bar { public function something() { echo __CLASS__; // foo_bar_baz var_dump($this); } public function call() { echo self::something(); // self echo parent::something(); // parent echo foo::something(); // grandparent } } error_reporting(-1); $obj = new foo_bar_baz(); $obj->call(); // Output similar to: // foo_bar_baz // object(foo_bar_baz)[1] // foo_bar // object(foo_bar_baz)[1] // foo // object(foo_bar_baz)[1] ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b0r7h
function name:  (null)
number of ops:  9
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
   39     3        NEW                                              $2      'foo_bar_baz'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   40     6        INIT_METHOD_CALL                                         !0, 'call'
          7        DO_FCALL                                      0          
   50     8      > RETURN                                                   1

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

End of function something

End of class foo.

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

End of function something

End of class foo_bar.

Class foo_bar_baz:
Function something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b0r7h
function name:  something
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ECHO                                                     'foo_bar_baz'
   26     1        INIT_FCALL                                               'var_dump'
          2        FETCH_THIS                                       ~0      
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
   27     5      > RETURN                                                   null

End of function something

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b0r7h
function name:  call
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_STATIC_METHOD_CALL                                  'something'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   32     3        INIT_STATIC_METHOD_CALL                                  'something'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
   33     6        INIT_STATIC_METHOD_CALL                                  'foo', 'something'
          7        DO_FCALL                                      0  $2      
          8        ECHO                                                     $2
   34     9      > RETURN                                                   null

End of function call

End of class foo_bar_baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.75 ms | 1400 KiB | 17 Q