Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Assertion failure when error handler throws when accessing a deprecated constant #19720

Closed
@dktapps

Description

@dktapps

Description

The following code:

<?phpfinalclass ErrorTypeToStringMap{privateconstERROR_STRINGS = [E_STRICT =>"E_STRICT",];privatefunction__construct(){}publicstaticfunctionget(int$errorType) :string{if(!isset(self::ERROR_STRINGS[$errorType])){thrownew \InvalidArgumentException("Invalid error type$errorType");}returnself::ERROR_STRINGS[$errorType];}}set_error_handler(function(int$severity,string$message,string$file,int$line):bool{thrownew \ErrorException($message,0,$severity,$file,$line);});var_dump(ErrorTypeToStringMap::get(E_ERROR));

Resulted in this output:

Assertion failed: !(((zend_executor_globals *) (((char*) _tsrm_ls_cache)+(executor_globals_offset)))->exception), file C:\pocketmine-php-8.4.12-debug\php-src\Zend\zend_vm_execute.h, line 35382

But I expected this output instead:

Fatal error: Uncaught InvalidArgumentException: Invalid error type 1 in C:\Users\dylan-work\Documents\projects\pocketmine-mp\stable\test4.php:16Stack trace:#0 C:\Users\dylan-work\Documents\projects\pocketmine-mp\stable\test4.php(30): ErrorTypeToStringMap::get(1)#1 {main}  thrown in C:\Users\dylan-work\Documents\projects\pocketmine-mp\stable\test4.php on line 16

PHP Version

PHP 8.4.12 (cli) (built: Sep  5 2025 15:31:51) (ZTS Visual C++ 2022 x64 DEBUG)Copyright (c) The PHP GroupZend Engine v4.4.12, Copyright (c) Zend Technologies    with Zend OPcache v8.4.12, Copyright (c), by Zend Technologies

Operating System

Windows 11

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp