1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00
Files
archived-php-src/Zend/tests/nullsafe_operator/constant_propagation.phpt
T
Nikita Popov 1f19401ffa Handle operand replacement in JMP_NULL
In this case it's not sufficient to replace the JMP_NULL operand,
as it keeps the temporary alive and there may be more uses later.
Fix this by generalizing existing handling for other similar opcodes
like CASE/SWITCH and LIST_R.

Fixes oss-fuzz 5820123475214336.
2021-10-19 15:19:02 +02:00

17 lines
250 B
PHP

--TEST--
Constant propagation with nullsafe operator
--FILE--
<?php
class Bar { const FOO = "foo"; }
try {
Bar::FOO?->length();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Call to a member function length() on string