Skip to content

phpdbg: exit in exception handler reports fatal error #16181

Description

@smuuf

Description

The following code:

<?php

set_exception_handler(function() {
	echo "exception caught\n";
	die;
});

echo "throwing exception\n";
throw new \Exception("oh noes");

...when executed with phpdbg8.3 -qrrb ohnoes.php resulted in this output:

$ phpdbg8.3 -qrrb ohnoes.php 
throwing exception
exception caught
[PHP Fatal error:  Invalid callback , no array or string given in Unknown on line 0]

But I expected this output instead:

$ phpdbg8.3 -qrrb ohnoes.php 
throwing exception
exception caught

... which would be the same as php8.3 ohnoes.php results in:

$ php8.3 ohnoes.php 
throwing exception
exception caught

PHP Version

PHP 8.3.12

Operating System

WSL2

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions