Skip to content

phpdbg: exit in exception handler reports fatal error #16181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
smuuf opened this issue Oct 2, 2024 · 0 comments
Closed

phpdbg: exit in exception handler reports fatal error #16181

smuuf opened this issue Oct 2, 2024 · 0 comments

Comments

@smuuf
Copy link

smuuf commented Oct 2, 2024

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

@cmb69 cmb69 self-assigned this Oct 2, 2024
cmb69 added a commit to cmb69/php-src that referenced this issue Oct 2, 2024
When running PHP code, we must not handle `UnwindExit` exceptions, but
rather have to ignore them.
@cmb69 cmb69 changed the title Bug in phpdbg8.3 - die/exit in exception handler reports Fatal Error phpdbg: exit in exception handler reports fatal error Oct 2, 2024
cmb69 added a commit that referenced this issue Oct 3, 2024
* PHP-8.2:
  Fix GH-16181: phpdbg: exit in exception handler reports fatal error
cmb69 added a commit that referenced this issue Oct 3, 2024
* PHP-8.3:
  Fix GH-16181: phpdbg: exit in exception handler reports fatal error
@cmb69 cmb69 closed this as completed in f14e5cf Oct 3, 2024
cmb69 added a commit that referenced this issue Oct 3, 2024
* PHP-8.4:
  Fix GH-16181: phpdbg: exit in exception handler reports fatal error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants