3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait AccessibleProperties { public function __isset($property) { return property_exists($this, $property); } public function __get($property) { if (property_exists($this, $property)) { return $this->$property; } } } class Foo4567 { use AccessibleProperties; protected $a = 'Some value'; } class Foo45 { use AccessibleProperties; protected $a = 'Some value'; } $foo = new Foo4567; var_dump(isset($foo->a)); $foo = new Foo45; var_dump($foo->a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GJLkJ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   DECLARE_CLASS                                                'foo4567'
   21     1        DECLARE_CLASS                                                'foo45'
   26     2        NEW                                                  $1      'Foo4567'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $1
   27     5        INIT_FCALL                                                   'var_dump'
          6        ISSET_ISEMPTY_PROP_OBJ                               ~4      !0, 'a'
          7        SEND_VAL                                                     ~4
          8        DO_ICALL                                                     
   28     9        NEW                                                  $6      'Foo45'
         10        DO_FCALL                                          0          
         11        ASSIGN                                                       !0, $6
   29    12        INIT_FCALL                                                   'var_dump'
         13        FETCH_OBJ_R                                          ~9      !0, 'a'
         14        SEND_VAL                                                     ~9
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Class AccessibleProperties:
Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GJLkJ
function name:  __isset
number of ops:  5
compiled vars:  !0 = $property
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    6     1        FETCH_THIS                                           ~1      
          2        FRAMELESS_ICALL_2                property_exists      ~2      ~1, !0
          3      > RETURN                                                       ~2
    7     4*     > RETURN                                                       null

End of function __isset

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GJLkJ
function name:  __get
number of ops:  7
compiled vars:  !0 = $property
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
   10     1        FETCH_THIS                                           ~1      
          2        FRAMELESS_ICALL_2                property_exists      ~2      ~1, !0
          3      > JMPZ                                                         ~2, ->6
   11     4    >   FETCH_OBJ_R                                          ~3      !0
          5      > RETURN                                                       ~3
   13     6    > > RETURN                                                       null

End of function __get

End of class AccessibleProperties.

Class Foo4567: [no user functions]
Class Foo45: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.67 ms | 1994 KiB | 14 Q