3v4l.org

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

Class StaticA:
Function classinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KR0pU
function name:  classInfo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                          self                $0      
          1        DO_FCALL                                      0          
          2        GET_CLASS                                        ~2      $0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
    6     5      > RETURN                                                   null

End of function classinfo

End of class StaticA.

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

End of function test

Function classinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KR0pU
function name:  classInfo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                          self                $0      
          1        DO_FCALL                                      0          
          2        GET_CLASS                                        ~2      $0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
    6     5      > RETURN                                                   null

End of function classinfo

End of class StaticB.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.14 ms | 1386 KiB | 13 Q