3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public stdClass $prop; public function __set($x, $y) { echo "SET\n"; $this->$x = $y; } } $a = new A(); $a->prop = new stdClass; var_dump($a); $a->undeclared = new stdClass; var_dump($a); $a->prop = new stdClass; var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Be7f
function name:  (null)
number of ops:  25
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        NEW                                              $5      'stdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'prop'
          6        OP_DATA                                                  $5
   17     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   19    10        NEW                                              $9      'stdClass'
         11        DO_FCALL                                      0          
         12        ASSIGN_OBJ                                               !0, 'undeclared'
         13        OP_DATA                                                  $9
   21    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   23    17        NEW                                              $13     'stdClass'
         18        DO_FCALL                                      0          
         19        ASSIGN_OBJ                                               !0, 'prop'
         20        OP_DATA                                                  $13
   25    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Class A:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Be7f
function name:  __set
number of ops:  6
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        ECHO                                                     'SET%0A'
    9     3        ASSIGN_OBJ                                               !0
          4        OP_DATA                                                  !1
   10     5      > RETURN                                                   null

End of function __set

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
229.35 ms | 1001 KiB | 14 Q