diff --git a/tests/TypeReconciliation/IssetTest.php b/tests/TypeReconciliation/IssetTest.php index fee46b96156..c26863d913c 100644 --- a/tests/TypeReconciliation/IssetTest.php +++ b/tests/TypeReconciliation/IssetTest.php @@ -1153,6 +1153,25 @@ private function __construct() {} }', 'error_message' => 'RedundantPropertyInitializationCheck', ], + 'setArbitraryListElementAfterIsset' => [ + 'code' => ' $list */ + function foo(array &$list, int $offset): void { + if (isset($list[$offset])) {} + $list[$offset] = ""; + }', + 'error_message' => 'ReferenceConstraintViolation' + ], + 'setArbitraryListWithinNotIsset' => [ + 'code' => ' $list */ + function foo(array &$list, int $offset): void { + if (!isset($list[$offset])) { + $list[$offset] = ""; + } + }', + 'error_message' => 'ReferenceConstraintViolation' + ], ]; } }