3v4l.org

run code in 300+ PHP versions simultaneously
<?php class example{ /*Member variables*/ protected $b = array(); public function &__get($name) { return $this->$name; } public function __set($name, $value) { $this->$name = $value; } } $fun = new example(); $x = &$fun->b; $x[] = 42; var_dump($fun->b); $fun->b[] = 42; var_dump($fun->b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iOeFo
function name:  (null)
number of ops:  19
compiled vars:  !0 = $fun, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'example'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   21     3        FETCH_OBJ_W                                      $5      !0, 'b'
          4        ASSIGN_REF                                               !1, $5
   22     5        ASSIGN_DIM                                               !1
          6        OP_DATA                                                  42
   24     7        INIT_FCALL                                               'var_dump'
          8        FETCH_OBJ_R                                      ~8      !0, 'b'
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                                 
   26    11        FETCH_OBJ_W                                      $10     !0, 'b'
         12        ASSIGN_DIM                                               $10
         13        OP_DATA                                                  42
   28    14        INIT_FCALL                                               'var_dump'
         15        FETCH_OBJ_R                                      ~12     !0, 'b'
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class example:
Function __get:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/iOeFo
function name:  __get
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        FETCH_OBJ_W                                      $1      !0
          2      > RETURN_BY_REF                                            $1
   11     3*     > RETURN_BY_REF                                            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/iOeFo
function name:  __set
number of ops:  5
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   16     4      > RETURN                                                   null

End of function __set

End of class example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.65 ms | 1396 KiB | 15 Q