3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private $data = array(); public function __get($key) { echo "get $key\n"; return $this->data[$key]; } public function __set($key, $value) { echo "set $key = $value\n"; $this->data[$key] = $value; } public function __isset($key) { return isset($this->data[$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/7E04f
function name:  (null)
number of ops:  28
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     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                                                 
   25    10        INIT_FCALL                                               'var_dump'
         11        ISSET_ISEMPTY_PROP_OBJ                           ~6      !0, 'x'
         12        SEND_VAL                                                 ~6
         13        DO_ICALL                                                 
   27    14        ASSIGN_OBJ                                               !0, 'x'
         15        OP_DATA                                                  42
   29    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                                                 
   30    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/7E04f
function name:  __get
number of ops:  9
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_OBJ_R                                      ~4      'data'
          6        FETCH_DIM_R                                      ~5      ~4, !0
          7      > RETURN                                                   ~5
   10     8*     > 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/7E04f
function name:  __set
number of ops:  12
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        FETCH_OBJ_W                                      $6      'data'
          9        ASSIGN_DIM                                               $6, !0
         10        OP_DATA                                                  !1
   15    11      > 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/7E04f
function name:  __isset
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        FETCH_OBJ_IS                                     ~1      'data'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          3      > RETURN                                                   ~2
   19     4*     > RETURN                                                   null

End of function __isset

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.65 ms | 1400 KiB | 17 Q