<?php
class C implements ArrayAccess {
public function offsetGet($k) {
echo "offsetGet: ";
var_dump($k);
}
public function offsetSet($k, $v) {}
public function offsetExists($k) {
echo "offsetExists: ";
var_dump($k);
}
public function offsetUnset($k) {}
}
$x = new C();
var_dump($x['123']);
var_dump(isset($x['123']));
Deprecated: Return type of C::offsetExists($k) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bC4tX on line 8
Deprecated: Return type of C::offsetGet($k) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bC4tX on line 3
Deprecated: Return type of C::offsetSet($k, $v) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bC4tX on line 7
Deprecated: Return type of C::offsetUnset($k) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bC4tX on line 12
offsetGet: string(3) "123"
NULL
offsetExists: string(3) "123"
bool(false)