Skip to content

Commit 44f7fe9

Browse files
committed
Zend: Move behaviour of dimension object handlers to VM
TODO still need to do unset and add proper new interfaces to implement for internal classes that are checked
1 parent ee6ccf2 commit 44f7fe9

File tree

6 files changed

+506
-78
lines changed

6 files changed

+506
-78
lines changed

Zend/tests/offsets/appending_containers_in_fetch.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ NULL
7474
Notice: Indirect modification of overloaded element of A has no effect in %s on line %d
7575
Error: Cannot use a scalar value as an array
7676
new B() container:
77+
string(12) "B::offsetGet"
78+
NULL
7779

7880
Notice: Indirect modification of overloaded element of B has no effect in %s on line %d
79-
ArgumentCountError: B::offsetGet(): Argument #1 ($offset) not passed
81+
Error: Cannot use a scalar value as an array

Zend/tests/offsets/internal_handlers_extended.phpt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,24 @@ class DoImplement extends DimensionHandlersNoArrayAccess implements ArrayAccess
3434
$no = new NoImplement();
3535
$do = new DoImplement();
3636

37-
$no['foo'];
37+
try {
38+
$no['foo'];
39+
} catch (\Throwable $e) {
40+
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
41+
}
3842
exportObject($no);
3943

40-
$do['foo'];
44+
try {
45+
$do['foo'];
46+
} catch (\Throwable $e) {
47+
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
48+
}
4149
exportObject($do);
4250

4351
?>
4452
--EXPECT--
45-
NoImplement, read: true, write: false, has: false, unset: false, readType: BP_VAR_R, hasOffset: true, checkEmpty: uninitialized, offset: 'foo'
46-
DoImplement, read: true, write: false, has: false, unset: false, readType: BP_VAR_R, hasOffset: true, checkEmpty: uninitialized, offset: 'foo'
53+
Error: Cannot use object of type NoImplement as array
54+
NoImplement, read: false, write: false, has: false, unset: false, readType: uninitialized, hasOffset: false, checkEmpty: uninitialized, offset: uninitialized
55+
string(22) "DoImplement::offsetGet"
56+
string(3) "foo"
57+
DoImplement, read: false, write: false, has: false, unset: false, readType: uninitialized, hasOffset: false, checkEmpty: uninitialized, offset: uninitialized

0 commit comments

Comments
 (0)