php-src/Zend/tests/bug33710.phpt
Máté Kocsis 75a678a7e3
Declare tentative return types for Zend (#7251)
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 13:44:20 +02:00

33 lines
556 B
PHP

--TEST--
Bug #33710 (ArrayAccess objects doesn't initialize $this)
--FILE--
<?php
class Foo implements ArrayAccess
{
function offsetExists($offset): bool { return true;}
function offsetGet($offset): mixed { return null; }
function offsetSet($offset, $value): void {/*...*/}
function offsetUnset($offset): void {/*...*/}
function fail()
{
$this['blah'];
}
function succeed()
{
$this;
$this['blah'];
}
}
$bar = new Foo();
$bar->succeed();
$bar->fail();
?>
===DONE===
--EXPECT--
===DONE===