3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); class ClassUsedForTyping { public int $x = 1234; } class ClassWithSetMagic { public function __construct() { printf("Constructor for ClassWithSetMagic\n"); } public function __set($name, $value) { printf("Setting %s\n", $name); } public function __get($name) { printf("Getting %s\n", $name); return null; } } class ClassInheritingFromClassWithSetMagic extends ClassWithSetMagic { public ClassUsedForTyping $example; public function __construct() { parent::__construct(); $this->example = new ClassUsedForTyping(); } } $inst = new ClassInheritingFromClassWithSetMagic(); print_r($inst->example);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9DBU
function name:  (null)
number of ops:  11
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                                                 
   36     3        NEW                                              $2      'ClassInheritingFromClassWithSetMagic'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   37     6        INIT_FCALL                                               'print_r'
          7        FETCH_OBJ_R                                      ~5      !0, 'example'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
         10      > 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/r9DBU
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/r9DBU
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

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

End of function __get

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/r9DBU
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   32     2        NEW                                              $2      'ClassUsedForTyping'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'example'
          5        OP_DATA                                                  $2
   33     6      > 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/r9DBU
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

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

End of function __get

End of class ClassInheritingFromClassWithSetMagic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.1 ms | 1007 KiB | 16 Q