Skip to content

php-cli core dump calling a badly formed function #8841

Closed
@gjcarrette

Description

@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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions