3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private $data = array(); public function __get($key) { echo "get $key\n"; return $$key; } public function __set($key, $value) { echo "set $key = $value\n"; $this->$key = $value; } public function __isset($key) { echo sprintf("isset $key ( returns %b )", isset($this->$key)); return isset($this->$key); } } $test = new test(); var_dump(property_exists($test, 'x')); var_dump(isset($test->x)); $test->x = 42; var_dump(property_exists($test, 'x')); var_dump(isset($test->x));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZTQJB
function name:  (null)
number of ops:  28
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'property_exists'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'x'
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   26    10        INIT_FCALL                                               'var_dump'
         11        ISSET_ISEMPTY_PROP_OBJ                           ~6      !0, 'x'
         12        SEND_VAL                                                 ~6
         13        DO_ICALL                                                 
   28    14        ASSIGN_OBJ                                               !0, 'x'
         15        OP_DATA                                                  42
   30    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'property_exists'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 'x'
         20        DO_ICALL                                         $9      
         21        SEND_VAR                                                 $9
         22        DO_ICALL                                                 
   31    23        INIT_FCALL                                               'var_dump'
         24        ISSET_ISEMPTY_PROP_OBJ                           ~11     !0, 'x'
         25        SEND_VAL                                                 ~11
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class test:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZTQJB
function name:  __get
number of ops:  8
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ROPE_INIT                                     3  ~2      'get+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    9     5        FETCH_R                      local               ~4      !0
          6      > RETURN                                                   ~4
   10     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/ZTQJB
function name:  __set
number of ops:  11
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        ROPE_INIT                                     5  ~3      'set+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '+%3D+'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '%0A'
          7        ECHO                                                     ~2
   14     8        ASSIGN_OBJ                                               !0
          9        OP_DATA                                                  !1
   15    10      > 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/ZTQJB
function name:  __isset
number of ops:  13
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'sprintf'
          2        ROPE_INIT                                     3  ~2      'isset+'
          3        ROPE_ADD                                      1  ~2      ~2, !0
          4        ROPE_END                                      2  ~1      ~2, '+%28+returns+%25b+%29'
          5        SEND_VAL                                                 ~1
          6        ISSET_ISEMPTY_PROP_OBJ                           ~4      !0
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        ECHO                                                     $5
   19    10        ISSET_ISEMPTY_PROP_OBJ                           ~6      !0
         11      > RETURN                                                   ~6
   20    12*     > RETURN                                                   null

End of function __isset

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.92 ms | 1400 KiB | 19 Q