3v4l.org

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

Class StaticA:
Function setemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/35boO
function name:  setEmail
number of ops:  4
compiled vars:  !0 = $redirect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'email'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function setemail

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

End of function doit

Function setemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/35boO
function name:  setEmail
number of ops:  4
compiled vars:  !0 = $redirect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'email'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function setemail

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

End of function classinfo

End of class StaticB.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.49 ms | 1394 KiB | 13 Q