3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); class ClassUsedForTyping { } class ClassWithSetMagic { public function __construct() { printf("Constructor for ClassWithSetMagic\n"); } public function __set($name, $value) { printf("Setting %s\n", $name); } } class ClassInheritingFromClassWithSetMagic extends ClassWithSetMagic { public ?ClassUsedForTyping $example = null; public function __construct() { printf("Constructor for ClassInheritingFromClassWithSetMagic\n"); $this->example = new ClassUsedForTyping(); parent::__construct(); } } $inst = new ClassInheritingFromClassWithSetMagic(); print_r($inst);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cEIOe
function name:  (null)
number of ops:  10
compiled vars:  !0 = $inst
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   33     3        NEW                                              $2      'ClassInheritingFromClassWithSetMagic'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   34     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class ClassUsedForTyping: [no user functions]
Class ClassWithSetMagic:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cEIOe
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'printf'
          1        SEND_VAL                                                 'Constructor+for+ClassWithSetMagic%0A'
          2        DO_ICALL                                                 
   15     3      > RETURN                                                   null

End of function __construct

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cEIOe
function name:  __set
number of ops:  7
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        INIT_FCALL                                               'printf'
          3        SEND_VAL                                                 'Setting+%25s%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   19     6      > RETURN                                                   null

End of function __set

End of class ClassWithSetMagic.

Class ClassInheritingFromClassWithSetMagic:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cEIOe
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'printf'
          1        SEND_VAL                                                 'Constructor+for+ClassInheritingFromClassWithSetMagic%0A'
          2        DO_ICALL                                                 
   28     3        NEW                                              $2      'ClassUsedForTyping'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               'example'
          6        OP_DATA                                                  $2
   29     7        INIT_STATIC_METHOD_CALL                                  
          8        DO_FCALL                                      0          
   30     9      > RETURN                                                   null

End of function __construct

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cEIOe
function name:  __set
number of ops:  7
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        INIT_FCALL                                               'printf'
          3        SEND_VAL                                                 'Setting+%25s%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   19     6      > RETURN                                                   null

End of function __set

End of class ClassInheritingFromClassWithSetMagic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.05 ms | 1005 KiB | 16 Q