3v4l.org

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

Class StaticA:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i0tF4
function name:  dosomething
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN_OBJ                                               'email'
          1        OP_DATA                                                  'e%4001art.de'
    7     2        NEW                          static              $2      
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
    8     5        INIT_METHOD_CALL                                         !0, 'classInfo'
          6        DO_FCALL                                      0          
    9     7      > RETURN                                                   null

End of function dosomething

Function classinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i0tF4
function name:  classInfo
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        GET_CLASS                                        ~3      $1
          3        CONCAT                                           ~4      ~3, '%0A'
          4        ECHO                                                     ~4
   12     5        FETCH_OBJ_R                                      ~5      !0, 'email'
          6        ECHO                                                     ~5
   13     7      > 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/i0tF4
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'classInfo'
          1        DO_FCALL                                      0          
   22     2      > RETURN                                                   null

End of function test

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

End of function doit

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i0tF4
function name:  dosomething
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN_OBJ                                               'email'
          1        OP_DATA                                                  'e%4001art.de'
    7     2        NEW                          static              $2      
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
    8     5        INIT_METHOD_CALL                                         !0, 'classInfo'
          6        DO_FCALL                                      0          
    9     7      > RETURN                                                   null

End of function dosomething

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

End of function classinfo

End of class StaticB.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150 ms | 944 KiB | 14 Q