3v4l.org

run code in 500+ PHP versions simultaneously
<?php #[AllowDynamicProperties] class C { public $_; public function __set($name, $value) { var_dump(__METHOD__); $this->$name = $value * 2; } } $rc = new ReflectionClass(C::class); $obj = $rc->newLazyProxy(function () { echo "init\n"; return new C; }); $obj->prop = 1; var_dump($obj->prop);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uFRia
function name:  (null)
number of ops:  16
compiled vars:  !0 = $rc, !1 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   NEW                                                  $2      'ReflectionClass'
          1        SEND_VAL_EX                                                  'C'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   15     4        INIT_METHOD_CALL                                             !0, 'newLazyProxy'
          5        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
   18     6        SEND_VAL_EX                                                  ~5
   15     7        DO_FCALL                                          0  $6      
          8        ASSIGN                                                       !1, $6
   20     9        ASSIGN_OBJ                                                   !1, 'prop'
         10        OP_DATA                                                      1
   21    11        INIT_FCALL                                                   'var_dump'
         12        FETCH_OBJ_R                                          ~9      !1, 'prop'
         13        SEND_VAL                                                     ~9
         14        DO_ICALL                                                     
         15      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uFRia
function name:  {closure:/in/uFRia:15}
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                         'init%0A'
   17     1        NEW                                                  $0      'C'
          2        DO_FCALL                                          0          
          3      > RETURN                                                       $0
   18     4*     > RETURN                                                       null

End of Dynamic Function 0

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

End of function __set

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
114.48 ms | 493 KiB | 10 Q