summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-13 09:55:13 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-13 09:55:13 +0200
commit213852de782df32a4de2cfc56a3d112c74db4ccf (patch)
treeaceb3e3ff0ae2465c520668e9e08d70d63bb0eea /Zend/tests
parent86e2b7bb70131b48636cded57e5bc62b81b79865 (diff)
downloadphp-git-213852de782df32a4de2cfc56a3d112c74db4ccf.tar.gz
Fixed bug #79828
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/bug79828.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/tests/bug79828.phpt b/Zend/tests/bug79828.phpt
new file mode 100644
index 0000000000..2bcb18e3e9
--- /dev/null
+++ b/Zend/tests/bug79828.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #79828: Segfault when trying to access non-existing variable
+--FILE--
+<?php
+function foo(): AnyType {
+ return $uninitialized;
+}
+foo();
+?>
+--EXPECTF--
+Warning: Undefined variable $uninitialized in %s on line %d
+
+Fatal error: Uncaught TypeError: foo(): Return value must be of type AnyType, null returned in %s:%d
+Stack trace:
+#0 %s(%d): foo()
+#1 {main}
+ thrown in %s on line %d