3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $a; protected $have_been_set = array(); public function __set($name, $val) { $this->have_been_set[$name] = TRUE; $this->{$name} = $val; } public function __isset($name) { print "checking for $name\n"; return array_key_exists($name, $this->have_been_set); } } $t1 = new Test(); $t1->a = null; $t2 = new Test(); var_dump( isSet($t1->a), isSet($t2->a) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gWTYm
function name:  (null)
number of ops:  15
compiled vars:  !0 = $t1, !1 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  null
   21     5        NEW                                              $6      'Test'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   23     8        INIT_FCALL                                               'var_dump'
          9        ISSET_ISEMPTY_PROP_OBJ                           ~9      !0, 'a'
         10        SEND_VAL                                                 ~9
         11        ISSET_ISEMPTY_PROP_OBJ                           ~10     !1, 'a'
         12        SEND_VAL                                                 ~10
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Test:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gWTYm
function name:  __set
number of ops:  8
compiled vars:  !0 = $name, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        FETCH_OBJ_W                                      $2      'have_been_set'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  <true>
   10     5        ASSIGN_OBJ                                               !0
          6        OP_DATA                                                  !1
   11     7      > 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/gWTYm
function name:  __isset
number of ops:  9
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ROPE_INIT                                     3  ~2      'checking+for+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
   15     5        FETCH_OBJ_R                                      ~4      'have_been_set'
          6        ARRAY_KEY_EXISTS                                 ~5      !0, ~4
          7      > RETURN                                                   ~5
   16     8*     > RETURN                                                   null

End of function __isset

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.19 ms | 1388 KiB | 15 Q