4
* This is in almost every respect equivalent to an array except
5
* that it keeps track of which keys were accessed.
7
* @warning For the sake of backwards compatibility with early versions
8
* of PHP 5, you must not use the $hash[$key] syntax; if you do
9
* our version of offsetGet is never called.
11
class HTMLPurifier_StringHash extends ArrayObject
13
protected $accessed = array();
16
* Retrieves a value, and logs the access.
18
public function offsetGet($index) {
19
$this->accessed[$index] = true;
20
return parent::offsetGet($index);
24
* Returns a lookup array of all array indexes that have been accessed.
25
* @return Array in form array($index => true).
27
public function getAccessed() {
28
return $this->accessed;
32
* Resets the access array.
34
public function resetAccessed() {
35
$this->accessed = array();
4
* This is in almost every respect equivalent to an array except
5
* that it keeps track of which keys were accessed.
7
* @warning For the sake of backwards compatibility with early versions
8
* of PHP 5, you must not use the $hash[$key] syntax; if you do
9
* our version of offsetGet is never called.
11
class HTMLPurifier_StringHash extends ArrayObject
16
protected $accessed = array();
19
* Retrieves a value, and logs the access.
23
public function offsetGet($index)
25
$this->accessed[$index] = true;
26
return parent::offsetGet($index);
30
* Returns a lookup array of all array indexes that have been accessed.
31
* @return array in form array($index => true).
33
public function getAccessed()
35
return $this->accessed;
39
* Resets the access array.
41
public function resetAccessed()
43
$this->accessed = array();