3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Model { protected $attributes = []; public function __set($key, $value) { echo 'called magic method: ', var_export([$key => $value], true), \PHP_EOL; } } $model = new \Model(); $model->attributes = 'foo'; var_dump($model);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RGIk3
function name:  (null)
number of ops:  9
compiled vars:  !0 = $model
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Model'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        ASSIGN_OBJ                                               !0, 'attributes'
          4        OP_DATA                                                  'foo'
   15     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Model:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RGIk3
function name:  __set
number of ops:  11
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ECHO                                                     'called+magic+method%3A+'
          3        INIT_FCALL                                               'var_export'
          4        INIT_ARRAY                                       ~2      !1, !0
          5        SEND_VAL                                                 ~2
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $3      
          8        ECHO                                                     $3
          9        ECHO                                                     '%0A'
    9    10      > RETURN                                                   null

End of function __set

End of class Model.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.54 ms | 1002 KiB | 16 Q