- Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- bool(false)
<?php
class Test extends stdClass implements ArrayAccess {
private $container = [];
public function offsetExists($key): bool
{
return isset($this->container[$key]);
}
public function offsetGet(mixed $key): mixed
{
return $this->container[$key];
}
public function offsetSet($key, $value): void
{
$this->container[$key] = $value;
}
public function offsetUnset($key): void
{
unset($this->container[$key]);
}
}
$test = new Test();
function foo(stdClass $c) {
var_dump(isset($c[0]));
}
foo($test);