php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33446 Referencing a variable makes everything a variable
Submitted: 2005-06-23 10:44 UTC Modified: 2005-06-23 10:51 UTC
From: bens at effortlessis dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.0.4 OS: WhiteBox Enterprise Linux 4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bens at effortlessis dot com
New email:
PHP Version: OS:

 

 [2005-06-23 10:44 UTC] bens at effortlessis dot com
Description:
------------
a) When you define a simple variable, and then reference it with another variable, both variables become references... What does this reference? Why does the status of a previously defined variable change? 

b) No modules defined. (./configure; make; make install;) 

Stock install, stock php.ini. 

Reproduce code:
---------------
<? 

$b=5; 
$a=&$b; 
var_dump(Get_Defined_Vars());

?> 

Expected result:
----------------
..... 
  ["b"]=>
  int(5)
  ["a"]=>
  &int(5)
} 

Actual result:
--------------
....
  ["b"]=>
  &int(5)
  ["a"]=>
  &int(5)
} 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-23 10:51 UTC] tony2001@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-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 30 10:00:01 2025 UTC