1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00
Files
archived-php-src/Zend/tests/bug74084.phpt
Nikita Popov a66c60cce3 Throw Error when writing property of non-object
This removes object auto-vivification support.

This also means that we can remove the corresponding special
handling for typed properites: We no longer need to check that a
property is convertible to stdClass if such a conversion might
take place indirectly due to a nested property write.

Additionally OBJ_W style operations now no longer modify the
object operand, and as such we no longer need to treat op1 as a
def in SSA form.

The next step would be to actually compile the whole LHS of OBJ_W
operations in R rather than W mode, but that causes issues with
SimpleXML, whose object handlers depend on the current compilation
structure.

Part of https://wiki.php.net/rfc/engine_warnings.
2019-09-27 10:11:47 +02:00

35 lines
584 B
PHP

--TEST--
Bug #74084 (Out of bound read - zend_mm_alloc_small)
--INI--
error_reporting=0
--FILE--
<?php
$$A += $$B['a'] = &$$C;
unset($$A);
try {
$$A -= $$B['a'] = &$$C;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
unset($$A);
try {
$$A *= $$B['a'] = &$$C;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
unset($$A);
try {
$$A /= $$B['a'] = &$$C;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
unset($$A);
$$A **= $$B['a'] = &$$C;
var_dump($$A);
?>
--EXPECT--
Unsupported operand types
Unsupported operand types
Unsupported operand types
int(0)