3 class ary
implements ArrayAccess
{
5 public function __construct($c = 2) {
8 public function offsetExists($i) {
11 public function offsetGet($i) {
14 public function offsetSet($i, $v) {
16 public function offsetUnset($i) {
21 $GLOBALS['gArray'] = array(1, 2, 'bob', 'cat');
22 $GLOBALS['gObj'] = new ary(4);
23 $GLOBALS['gInt'] = 24;
24 $GLOBALS['gStr'] = '01234567890';
28 var_dump($GLOBALS['gArray'][2]);
29 var_dump($GLOBALS['gObj'][6]);
30 var_dump($GLOBALS['gInt'][1]);
31 var_dump($GLOBALS['gStr'][3]);
33 $idx = array(2, 6, 1, 3);
34 foreach (array('gArray', 'gObj', 'gInt', 'gStr') as $dyn) {
35 var_dump($GLOBALS[$dyn][array_shift($idx)]);
41 function non_exist() {
42 $a = $GLOBALS['doesnt_exist'][12];
45 foreach ($GLOBALS as $k => $v) {
46 if ($k == 'doesnt_exist') {