Bug #80234 [NEW]: user-defined error handler and string numeric keys in $errcontext
| From: | david at grudl dot com | Date: | Wed, 14 Oct 2020 11:36:06 +0000 |
| Subject: | Bug #80234 [NEW]: user-defined error handler and string numeric keys in $errcontext | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-229612@lists.php.net to get a copy of this message | ||
From: david at grudl dot com
Operating system:
PHP version: 7.4.11
Package: Scripting Engine problem
Bug Type: Bug
Bug description:user-defined error handler and string numeric keys in $errcontext
Description:
------------
Array $context passed to custom error handler is non-standard because
contains string numeric keys. Example: https://3v4l.org/BR04H
Because $context is deprecated, there is no need to fix it, I just
wanted to document it.
Test script:
---------------
<?php
set_error_handler(function ($errno, $errstr, $errfile, $errline,
$errcontext) {
var_dump($context);
});
$a = 1;
$$a = 2;
Expected result:
----------------
array(3) { [1]=> int(2), ... }
Actual result:
--------------
array(3) { ["1"]=> int(2), ... }
--
Edit bug report at https://bugs.php.net/bug.php?id=80234&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80234&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80234&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80234&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80234&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80234&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80234&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80234&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80234&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80234&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80234&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80234&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80234&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80234&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80234&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80234&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80234&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80234&r=mysqlcfg