Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. * @return bool
  2.  
  3.      */
  4.  
  5.     public function offsetExists($key)
  6.  
  7.     {
  8.  
  9.         return array_key_exists($key, $this->items);
  10.  
  11.     }
  12.  
  13.  
  14.  
  15.     /**
  16.  
  17.      * Get an item at a given offset.
  18.  
  19.      *
  20.  
  21.      * @param  mixed  $key
  22.  
  23.      * @return mixed
  24.  
  25.      */
  26.  
  27.     public function offsetGet($key)
  28.  
  29.     {
  30.  
  31.         return $this->items[$key];
  32.  
  33.     }
  34.  
  35.  
  36.  
  37.     /**
  38.  
  39.      * Set the item at a given offset.
  40.  
  41.      *
  42.  
  43.      * @param  mixed  $key
  44.  
  45.      * @param  mixed  $value
  46.  
  47.      * @return void
  48.  
  49.      */
  50.  
  51.     public function offsetSet($key, $value)
  52.  
  53.     {
  54.  
  55.         if (is_null($key)) {
  56.  
  57.             $this->items[] = $value;
  58.  
  59.         } else {
  60.  
  61.             $this->items[$key] = $value;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement