3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function __construct() { $this->something(); } public function something() { echo __CLASS__; // foo var_dump($this); } } class foo_bar extends foo { public function __construct() { parent::something(); $this->something(); } public function something() { echo __CLASS__; // foo_bar var_dump($this); } } class foo_bar_baz extends foo_bar { public function __construct() { parent::something(); $this->something(); } 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 } } $obj = new foo_bar_baz();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qPbMn
function name:  (null)
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   NEW                                              $1      'foo_bar_baz'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qPbMn
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_METHOD_CALL                                         'something'
          1        DO_FCALL                                      0          
    7     2      > RETURN                                                   null

End of function __construct

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

End of function something

End of class foo.

Class foo_bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qPbMn
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'something'
          1        DO_FCALL                                      0          
   20     2        INIT_METHOD_CALL                                         'something'
          3        DO_FCALL                                      0          
   21     4      > RETURN                                                   null

End of function __construct

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

End of function something

End of class foo_bar.

Class foo_bar_baz:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qPbMn
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_STATIC_METHOD_CALL                                  'something'
          1        DO_FCALL                                      0          
   34     2        INIT_METHOD_CALL                                         'something'
          3        DO_FCALL                                      0          
   35     4      > RETURN                                                   null

End of function __construct

Function something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qPbMn
function name:  something
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   ECHO                                                     'foo_bar_baz'
   39     1        INIT_FCALL                                               'var_dump'
          2        FETCH_THIS                                       ~0      
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
   40     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/qPbMn
function name:  call
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   INIT_STATIC_METHOD_CALL                                  'something'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   44     3        INIT_STATIC_METHOD_CALL                                  'something'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
   45     6        INIT_STATIC_METHOD_CALL                                  'foo', 'something'
          7        DO_FCALL                                      0  $2      
          8        ECHO                                                     $2
   46     9      > RETURN                                                   null

End of function call

End of class foo_bar_baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.4 ms | 1392 KiB | 15 Q