3v4l.org

run code in 300+ PHP versions simultaneously
<?php class First { public function test1() { echo get_called_class(); } public function test2() { print_r(debug_backtrace()); } public function test3() { echo get_class($this); } public function test4() { echo __CLASS__; } public static function test5() { echo get_called_class(); } } class_alias('First', 'Second'); $aliased = new Second(); $aliased->test1(); // First $aliased->test2(); // array( 0 => array( ... [object] => First Object, ... ) ) $aliased->test3(); // First $aliased->test4(); // First Second::test5(); // First
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IpKVc
function name:  (null)
number of ops:  18
compiled vars:  !0 = $aliased
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'class_alias'
          1        SEND_VAL                                                 'First'
          2        SEND_VAL                                                 'Second'
          3        DO_ICALL                                                 
   11     4        NEW                                              $2      'Second'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   12     7        INIT_METHOD_CALL                                         !0, 'test1'
          8        DO_FCALL                                      0          
   13     9        INIT_METHOD_CALL                                         !0, 'test2'
         10        DO_FCALL                                      0          
   14    11        INIT_METHOD_CALL                                         !0, 'test3'
         12        DO_FCALL                                      0          
   15    13        INIT_METHOD_CALL                                         !0, 'test4'
         14        DO_FCALL                                      0          
   16    15        INIT_STATIC_METHOD_CALL                                  'Second', 'test5'
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

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

End of function test1

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

End of function test2

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

End of function test3

Function test4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IpKVc
function name:  test4
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'First'
          1      > RETURN                                                   null

End of function test4

Function test5:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IpKVc
function name:  test5
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   GET_CALLED_CLASS                                 ~0      
          1        ECHO                                                     ~0
          2      > RETURN                                                   null

End of function test5

End of class First.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.31 ms | 1452 KiB | 16 Q