Bug #76383 [NEW]: array_map on $GLOBALS returns IS_INDIRECT
| From: | bwoebi@php.net | Date: | Sun, 27 May 2018 22:47:02 +0000 |
| Subject: | Bug #76383 [NEW]: array_map on $GLOBALS returns IS_INDIRECT | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-215393@lists.php.net to get a copy of this message | ||
From: bwoebi
Operating system: Irrelevant
PHP version: 7.2Git-2018-05-27 (Git)
Package: Reproducible crash
Bug Type: Bug
Bug description:array_map on $GLOBALS returns IS_INDIRECT
Description:
------------
Since PHP 7, an array_map on $GLOBALS returns an IS_INDIRECT zval
instead of a value.
Test script:
---------------
array_map(function($x) use (&$lastval) { $lastval = $x; }, $GLOBALS);
extract([], 0, $lastval); // for example, anything that will fail on an
invalid type
// or for direct proof, giving unknown type
var_dump(gettype($lastval));
Expected result:
----------------
NULL // on gettype
Actual result:
--------------
Assertion failed: (0), function _convert_to_string, file
/Users/Bob/php-src-X/Zend/zend_operators.c, line 585.
Abort trap: 6
--
Edit bug report at https://bugs.php.net/bug.php?id=76383&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76383&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76383&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76383&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76383&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76383&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76383&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76383&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76383&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76383&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76383&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76383&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76383&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76383&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76383&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76383&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76383&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76383&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76383&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76383&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76383&r=mysqlcfg