3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Data implements \ArrayAccess, \Countable, \IteratorAggregate { /** * * Key-value pairs of data. * * @var array * */ protected $data = array(); /** * * Constructor. * * @param array $data The data for this object. * */ public function __construct(array $data = array()) { $this->data = $data; } /** * * ArrayAccess: does the requested key exist? * * @param int|string $key The requested key. * * @return bool * */ public function offsetExists($key) { return array_key_exists($key, $this->data); } /** * * ArrayAccess: get a key value. * * @param int|string $key The requested key. * * @return mixed * */ public function offsetGet($key) { return $this->data[$key]; } /** * * ArrayAccess: set a key value. * * @param int|string $key The requested key. * * @param mixed $val The value to set it to. * * @return void * */ public function offsetSet($key, $val) { $this->data[$key] = $val; } /** * * ArrayAccess: unset a key. * * @param int|string $key The requested key. * * @return void * */ public function offsetUnset($key) { unset($this->data[$key]); } /** * * Countable: how many keys are there? * * @return int * */ public function count() { return count($this->data); } /** * * IteratorAggregate: returns an external iterator for this struct. * * @return DataIterator * */ public function getIterator() { return new DataIterator($this, array_keys($this->data)); } public function __invoke() { } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'data'
  110     1      > RETURN                                                   1

Class Data:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  __construct
number of ops:  4
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV_INIT                                        !0      <array>
   22     1        ASSIGN_OBJ                                               'data'
          2        OP_DATA                                                  !0
   23     3      > RETURN                                                   null

End of function __construct

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  offsetExists
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   36     1        FETCH_OBJ_R                                      ~1      'data'
          2        ARRAY_KEY_EXISTS                                 ~2      !0, ~1
          3      > RETURN                                                   ~2
   37     4*     > RETURN                                                   null

End of function offsetexists

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  offsetGet
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV                                             !0      
   50     1        FETCH_OBJ_R                                      ~1      'data'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   51     4*     > RETURN                                                   null

End of function offsetget

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $key, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   64     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   66     2        FETCH_OBJ_W                                      $2      'data'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   67     5      > RETURN                                                   null

End of function offsetset

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  offsetUnset
number of ops:  4
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   78     0  E >   RECV                                             !0      
   80     1        FETCH_OBJ_UNSET                                  $1      'data'
          2        UNSET_DIM                                                $1, !0
   81     3      > RETURN                                                   null

End of function offsetunset

Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  count
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   92     0  E >   FETCH_OBJ_R                                      ~0      'data'
          1        COUNT                                            ~1      ~0
          2      > RETURN                                                   ~1
   93     3*     > RETURN                                                   null

End of function count

Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  getIterator
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  104     0  E >   NEW                                              $0      'DataIterator'
          1        FETCH_THIS                                       $1      
          2        SEND_VAR_EX                                              $1
          3        INIT_FCALL                                               'array_keys'
          4        FETCH_OBJ_R                                      ~2      'data'
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7        SEND_VAR_NO_REF_EX                                       $3
          8        DO_FCALL                                      0          
          9      > RETURN                                                   $0
  105    10*     > RETURN                                                   null

End of function getiterator

Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnlvY
function name:  __invoke
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  109     0  E > > RETURN                                                   null

End of function __invoke

End of class Data.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.99 ms | 1392 KiB | 15 Q