3v4l.org

run code in 500+ PHP versions simultaneously
<?php class base implements ArrayAccess { public function offsetSet($propertyName, $value) { $this->$propertyName = $value; } public function offsetExists($propertyName) { return isset($this->$propertyName); } public function offsetUnset($propertyName) { unset($this->$propertyName); } public function offsetGet($propertyName) { return isset($this->$propertyName) ? $this->$propertyName : null; } } class User extends base { public $foreName; public $familyName; public function __construct($forename, $familyname) { $this->foreName = $forename; $this->familyName = $familyname; } } $data = new User('Mark', 'Baker'); echo $data['foreName'], PHP_EOL; $data['foreName'] = 'SuperMark'; echo $data['foreName'], PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MajRB
function name:  (null)
number of ops:  16
compiled vars:  !0 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'base'
   21     1        DECLARE_CLASS                                                'user', 'base'
   30     2        NEW                                                  $1      'User'
          3        SEND_VAL_EX                                                  'Mark'
          4        SEND_VAL_EX                                                  'Baker'
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !0, $1
   32     7        FETCH_DIM_R                                          ~4      !0, 'foreName'
          8        ECHO                                                         ~4
          9        ECHO                                                         '%0A'
   33    10        ASSIGN_DIM                                                   !0, 'foreName'
         11        OP_DATA                                                      'SuperMark'
   34    12        FETCH_DIM_R                                          ~6      !0, 'foreName'
         13        ECHO                                                         ~6
         14        ECHO                                                         '%0A'
         15      > RETURN                                                       1

Class base:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MajRB
function name:  offsetSet
number of ops:  5
compiled vars:  !0 = $propertyName, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    5     2        ASSIGN_OBJ                                                   !0
          3        OP_DATA                                                      !1
    6     4      > RETURN                                                       null

End of function offsetset

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MajRB
function name:  offsetExists
number of ops:  4
compiled vars:  !0 = $propertyName
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        ISSET_ISEMPTY_PROP_OBJ                               ~1      !0
          2      > RETURN                                                       ~1
   10     3*     > RETURN                                                       null

End of function offsetexists

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MajRB
function name:  offsetUnset
number of ops:  3
compiled vars:  !0 = $propertyName
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   13     1        UNSET_OBJ                                                    !0
   14     2      > RETURN                                                       null

End of function offsetunset

Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MajRB
function name:  offsetGet
number of ops:  9
compiled vars:  !0 = $propertyName
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
   17     1        ISSET_ISEMPTY_PROP_OBJ                                       !0
          2      > JMPZ                                                         ~1, ->6
          3    >   FETCH_OBJ_R                                          ~2      !0
          4        QM_ASSIGN                                            ~3      ~2
          5      > JMP                                                          ->7
          6    >   QM_ASSIGN                                            ~3      null
          7    > > RETURN                                                       ~3
   18     8*     > RETURN                                                       null

End of function offsetget

End of class base.

Class User:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MajRB
function name:  __construct
number of ops:  7
compiled vars:  !0 = $forename, !1 = $familyname
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   25     2        ASSIGN_OBJ                                                   'foreName'
          3        OP_DATA                                                      !0
   26     4        ASSIGN_OBJ                                                   'familyName'
          5        OP_DATA                                                      !1
   27     6      > RETURN                                                       null

End of function __construct

End of class User.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
232.72 ms | 2702 KiB | 13 Q