3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $publicProperty; protected $protectedProperty; private $privateProperty; public function __construct() { unset( $this->publicProperty, $this->protectedProperty, $this->privateProperty ); } function __get($name) { echo '__get ' . $name . "\n"; return $this->$name; } function __set($name, $value) { echo '__set ' . $name . "\n"; $this->$name = $value; } function __isset($name) { echo '__isset ' . $name . "\n"; return isset($this->$name); } } $test = new Test(); $test->nonExisting; $test->publicProperty; $test->protectedProperty; $test->privateProperty; isset($test->nonExisting); isset($test->publicProperty); isset($test->protectedProperty); isset($test->privateProperty); $test->nonExisting = 'value'; $test->publicProperty = 'value'; $test->protectedProperty = 'value'; $test->privateProperty = 'value'; ?> --EXPECTF-- __get nonExisting Notice: Undefined index: nonExisting in %__set__get_006.php on line %d __get publicProperty Notice: Undefined index: publicProperty in %__set__get_006.php on line %d __get protectedProperty Notice: Undefined index: protectedProperty in %__set__get_006.php on line %d __get privateProperty Notice: Undefined index: protectedProperty in %__set__get_006.php on line %d __isset nonExisting __isset publicProperty __isset protectedProperty __isset privateProperty __set nonExisting __set publicProperty __set protectedProperty __set privateProperty
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XWAgg
function name:  (null)
number of ops:  29
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   33     3        FETCH_OBJ_R                                      ~4      !0, 'nonExisting'
          4        FREE                                                     ~4
   34     5        FETCH_OBJ_R                                      ~5      !0, 'publicProperty'
          6        FREE                                                     ~5
   35     7        FETCH_OBJ_R                                      ~6      !0, 'protectedProperty'
          8        FREE                                                     ~6
   36     9        FETCH_OBJ_R                                      ~7      !0, 'privateProperty'
         10        FREE                                                     ~7
   37    11        ISSET_ISEMPTY_PROP_OBJ                           ~8      !0, 'nonExisting'
         12        FREE                                                     ~8
   38    13        ISSET_ISEMPTY_PROP_OBJ                           ~9      !0, 'publicProperty'
         14        FREE                                                     ~9
   39    15        ISSET_ISEMPTY_PROP_OBJ                           ~10     !0, 'protectedProperty'
         16        FREE                                                     ~10
   40    17        ISSET_ISEMPTY_PROP_OBJ                           ~11     !0, 'privateProperty'
         18        FREE                                                     ~11
   41    19        ASSIGN_OBJ                                               !0, 'nonExisting'
         20        OP_DATA                                                  'value'
   42    21        ASSIGN_OBJ                                               !0, 'publicProperty'
         22        OP_DATA                                                  'value'
   43    23        ASSIGN_OBJ                                               !0, 'protectedProperty'
         24        OP_DATA                                                  'value'
   44    25        ASSIGN_OBJ                                               !0, 'privateProperty'
         26        OP_DATA                                                  'value'
   47    27        ECHO                                                     '+%0A--EXPECTF--%0A__get+nonExisting%0ANotice%3A+Undefined+index%3A+nonExisting+in+%25__set__get_006.php+on+line+%25d%0A__get+publicProperty%0ANotice%3A+Undefined+index%3A+publicProperty+in+%25__set__get_006.php+on+line+%25d%0A__get+protectedProperty%0ANotice%3A+Undefined+index%3A+protectedProperty+in+%25__set__get_006.php+on+line+%25d%0A__get+privateProperty%0ANotice%3A+Undefined+index%3A+protectedProperty+in+%25__set__get_006.php+on+line+%25d%0A__isset+nonExisting%0A__isset+publicProperty%0A__isset+protectedProperty%0A__isset+privateProperty%0A__set+nonExisting%0A__set+publicProperty%0A__set+protectedProperty%0A__set+privateProperty'
   64    28      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XWAgg
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   UNSET_OBJ                                                'publicProperty'
   10     1        UNSET_OBJ                                                'protectedProperty'
   11     2        UNSET_OBJ                                                'privateProperty'
   13     3      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XWAgg
function name:  __get
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        CONCAT                                           ~1      '__get+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   17     4        FETCH_OBJ_R                                      ~3      !0
          5      > RETURN                                                   ~3
   18     6*     > 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/XWAgg
function name:  __set
number of ops:  8
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        CONCAT                                           ~2      '__set+', !0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
   22     5        ASSIGN_OBJ                                               !0
          6        OP_DATA                                                  !1
   23     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/XWAgg
function name:  __isset
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        CONCAT                                           ~1      '__isset+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   27     4        ISSET_ISEMPTY_PROP_OBJ                           ~3      !0
          5      > RETURN                                                   ~3
   28     6*     > RETURN                                                   null

End of function __isset

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.95 ms | 1403 KiB | 13 Q