php-src/Zend/tests/bug69955.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

36 lines
830 B
PHP

--TEST--
Bug #69955 (Segfault when trying to combine [] and assign-op on ArrayAccess object).
--FILE--
<?php
class C10 implements ArrayAccess
{
function offsetExists($offset)
{
echo "\nInside " . __METHOD__ . "\n"; var_dump($offset);
}
function offsetGet($offset)
{
echo "\nInside " . __METHOD__ . "\n"; var_dump($offset); return 100;
}
function offsetSet($offset, $value)
{
echo "\nInside " . __METHOD__ . "\n"; var_dump($offset); var_dump($value);
}
function offsetUnset($offset)
{
echo "\nInside " . __METHOD__ . "\n"; var_dump($offset);
}
}
$c10 = new C10;
var_dump($c10[] += 5);
--EXPECT--
Inside C10::offsetGet
NULL
Inside C10::offsetSet
NULL
int(105)
int(105)