3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Magic { public $a = "A"; protected $b = array("a"=>"A","b"=>"B","c"=>"C"); protected $c = array(1,2,3); public function __get($v) { echo "$v,"; return $this->b[$v]; } public function __set($var, $val) { echo "$var: $val,"; $this->$var = $val; } } $m = new Magic(); var_dump($m->a); echo $m->a.",".$m->b.",".$m->c.","; $m->c = "CC"; echo $m->a.",".$m->b.",".$m->c;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/030uM
function name:  (null)
number of ops:  27
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Magic'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~4      !0, 'a'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
   22     7        FETCH_OBJ_R                                      ~6      !0, 'a'
          8        CONCAT                                           ~7      ~6, '%2C'
          9        FETCH_OBJ_R                                      ~8      !0, 'b'
         10        CONCAT                                           ~9      ~7, ~8
         11        CONCAT                                           ~10     ~9, '%2C'
         12        FETCH_OBJ_R                                      ~11     !0, 'c'
         13        CONCAT                                           ~12     ~10, ~11
         14        CONCAT                                           ~13     ~12, '%2C'
         15        ECHO                                                     ~13
   23    16        ASSIGN_OBJ                                               !0, 'c'
         17        OP_DATA                                                  'CC'
   24    18        FETCH_OBJ_R                                      ~15     !0, 'a'
         19        CONCAT                                           ~16     ~15, '%2C'
         20        FETCH_OBJ_R                                      ~17     !0, 'b'
         21        CONCAT                                           ~18     ~16, ~17
         22        CONCAT                                           ~19     ~18, '%2C'
         23        FETCH_OBJ_R                                      ~20     !0, 'c'
         24        CONCAT                                           ~21     ~19, ~20
         25        ECHO                                                     ~21
         26      > RETURN                                                   1

Class Magic:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/030uM
function name:  __get
number of ops:  8
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      !0, '%2C'
          3        ECHO                                                     ~1
   10     4        FETCH_OBJ_R                                      ~2      'b'
          5        FETCH_DIM_R                                      ~3      ~2, !0
          6      > RETURN                                                   ~3
   11     7*     > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/030uM
function name:  __set
number of ops:  10
compiled vars:  !0 = $var, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        ROPE_INIT                                     4  ~3      !0
          3        ROPE_ADD                                      1  ~3      ~3, '%3A+'
          4        ROPE_ADD                                      2  ~3      ~3, !1
          5        ROPE_END                                      3  ~2      ~3, '%2C'
          6        ECHO                                                     ~2
   15     7        ASSIGN_OBJ                                               !0
          8        OP_DATA                                                  !1
   16     9      > RETURN                                                   null

End of function __set

End of class Magic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.29 ms | 1405 KiB | 15 Q