1--TEST--
2Internal handlers that do not explicitly support userland ArrayAccess
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7
8require_once __DIR__ . DIRECTORY_SEPARATOR . 'test_offset_helpers.inc';
9
10class NoImplement extends DimensionHandlersNoArrayAccess {}
11
12class DoImplement extends DimensionHandlersNoArrayAccess implements ArrayAccess {
13    public function offsetSet($offset, $value): void {
14        var_dump(__METHOD__);
15        var_dump($offset);
16        var_dump($value);
17    }
18    public function offsetGet($offset): mixed {
19        var_dump(__METHOD__);
20        var_dump($offset);
21        return "dummy";
22    }
23    public function offsetUnset($offset): void {
24        var_dump(__METHOD__);
25        var_dump($offset);
26    }
27    public function offsetExists($offset): bool {
28        var_dump(__METHOD__);
29        var_dump($offset);
30        return true;
31    }
32}
33
34$no = new NoImplement();
35$do = new DoImplement();
36
37$no['foo'];
38exportObject($no);
39
40$do['foo'];
41exportObject($do);
42
43?>
44--EXPECT--
45NoImplement, read: true, write: false, has: false, unset: false, readType: BP_VAR_R, hasOffset: true, checkEmpty: uninitialized, offset: 'foo'
46DoImplement, read: true, write: false, has: false, unset: false, readType: BP_VAR_R, hasOffset: true, checkEmpty: uninitialized, offset: 'foo'
47