Skip to content

phpdbg: exit in exception handler reports fatal error #16181

Closed

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

Activity

  1. self-assigned this
    on Oct 2, 2024
  2. added a commit that references this issue on Oct 2, 2024
    50f9d37
  3. changed the title [-]Bug in phpdbg8.3 - die/exit in exception handler reports `Fatal Error`[/-] [+]phpdbg: exit in exception handler reports fatal error[/+] on Oct 2, 2024
  4. added 3 commits that reference this issue on Oct 3, 2024
    f14e5cf
    95c97c8
    3c1af3f
  5. added a commit that references this issue on Oct 3, 2024
    2f09c0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions