Bug #79765 [NEW]: undefined array index gets set when passed by reference
| From: | wspademan at gmail dot com | Date: | Wed, 01 Jul 2020 13:43:16 +0000 |
| Subject: | Bug #79765 [NEW]: undefined array index gets set when passed by reference | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227761@lists.php.net to get a copy of this message | ||
From: wspademan at gmail dot com
Operating system: Windows & Centos
PHP version: 8.0.0alpha1
Package: Scripting Engine problem
Bug Type: Bug
Bug description:undefined array index gets set when passed by reference
Description:
------------
This script apparently fails since PHP version 4.4.9 or earlier (tested
using http://sandbox.onlinephpfunctions.com/)
Test script:
---------------
<?php
function check(&$value) {}
$a = array();
check($a['b']);
echo count($a); // should be 0, but is 1
print_r($a); // $a should be [], but is ['b' => NULL]
Expected result:
----------------
see comments in script
Actual result:
--------------
see comments in script
--
Edit bug report at https://bugs.php.net/bug.php?id=79765&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79765&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79765&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79765&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79765&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79765&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79765&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79765&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79765&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79765&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79765&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79765&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79765&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79765&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79765&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79765&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79765&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79765&r=mysqlcfg