xref: /PHP-8.1/Zend/tests/bug79828.phpt (revision 213852de)
1--TEST--
2Bug #79828: Segfault when trying to access non-existing variable
3--FILE--
4<?php
5function foo(): AnyType {
6   return $uninitialized;
7}
8foo();
9?>
10--EXPECTF--
11Warning: Undefined variable $uninitialized in %s on line %d
12
13Fatal error: Uncaught TypeError: foo(): Return value must be of type AnyType, null returned in %s:%d
14Stack trace:
15#0 %s(%d): foo()
16#1 {main}
17  thrown in %s on line %d
18