3v4l.org

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

Class A:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gq9PP
function name:  __get
number of ops:  6
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ECHO                                                     '__get+called%0A'
    8     2        FETCH_OBJ_R                                      ~1      '_vars'
          3        FETCH_DIM_R                                      ~2      ~1, !0
          4      > RETURN                                                   ~2
    9     5*     > 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/Gq9PP
function name:  __set
number of ops:  7
compiled vars:  !0 = $var, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        ECHO                                                     '__set+called%0A'
   12     3        FETCH_OBJ_W                                      $2      '_vars'
          4        ASSIGN_DIM                                               $2, !0
          5        OP_DATA                                                  !1
   13     6      > RETURN                                                   null

End of function __set

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gq9PP
function name:  __isset
number of ops:  6
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ECHO                                                     '__isset+called%0A'
   16     2        FETCH_OBJ_IS                                     ~1      '_vars'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          4      > RETURN                                                   ~2
   17     5*     > RETURN                                                   null

End of function __isset

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.97 ms | 1400 KiB | 15 Q