3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class X { function bar() { var_dump(get_called_class()); } } class Y { function foo() { X::bar(); } } class Z extends X { function foo() { X::bar(); } } (new Y)->foo(); (new Z)->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AfQlN
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    7     3        NEW                                              $1      'Y'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $1, 'foo'
          6        DO_FCALL                                      0          
    8     7        NEW                                              $4      'Z'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $4, 'foo'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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

End of function bar

End of class X.

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

End of function foo

End of class Y.

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

End of function foo

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

End of function bar

End of class Z.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.72 ms | 1392 KiB | 17 Q