[php-src] Issue #8841: php-cli core dump calling a badly formed function
| From: | gjcarrette | Date: | Tue, 21 Jun 2022 15:57:28 +0000 |
| Subject: | [php-src] Issue #8841: php-cli core dump calling a badly formed function | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241779@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8841
Author: gjcarrette
### Description
The following interaction gives a SEGV
```
$ rpm -q php-cli
php-cli-8.1.4-1.el8.remi.x86_64
$ php -n -dauto_prepend_file= -a
Interactive shell
php > echo phpversion();
8.1.4
php > function f ($x): void { return $x;}
Fatal error: A void function must not return a value in php shell code on line 1
php > f(10);
Segmentation fault (core dumped)
```
Resulted in this output:
```
Segmentation fault (core dumped)
```
But I expected this output instead:
```
Warning: Uncaught Error: Call to undefined function f() in php shell code:1
```
Well anything but a core dump.
This happens in PHP 7.4 too so it is not a PHP 8.1 regression.
### PHP Version
PHP 8.1.4
### Operating System
CentOS Linux release 7.5.1804 (Core)