php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29285 taking array reference creates value
Submitted: 2004-07-20 20:35 UTC Modified: 2004-07-20 22:28 UTC
From: fred dot leitz at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.7 OS: FreeBSD 5.2.1-p9
Private report: No CVE-ID: None
 [2004-07-20 20:35 UTC] fred dot leitz at gmail dot com
Description:
------------
When taking a reference from an associative array where the key does not exist a key is created and the value set to null.



Reproduce code:
---------------
$test = array();

$x = &$test["test"];
print_r($test);



Expected result:
----------------
Array (  )

Actual result:
--------------
Array ( [test] => )

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-20 22:28 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 09:01:27 2024 UTC