php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6233 references, assignment of references, re-referencing
Submitted: 2000-08-18 06:37 UTC Modified: 2000-08-21 09:54 UTC
From: waldschrott@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (18/08/2000) OS: *
Private report: No CVE-ID: None
 [2000-08-18 06:37 UTC] waldschrott@php.net
Unfortunately there was no comment on the list, thus storing the results here for expert review...
initial problem 1) If there?s an unnecessary copy between object creation (new foo;) and the assignment $x = ~
we sould remove this...

solution 1) It doesn?t influence all my code replacing *all* function foo() with function &foo(), this let?s me believe that there?s an unnecessary copy again, what would the impact (currently) be, if all funtions return references?
well and thus the & operator seems to have no function, because the = assignment operator cannot handle references and creates a copy (if I got stas? comment right)
If I?m not missing sth the & operator in function names has currently *no* effect and it would get an effect making the assignement capable of handling references

problem 2) already known (unfortunately only be a small circle of persons= not documented),
it?s not possible to re-reference
foo($zoo);
function foo(&$boo) {
  $boo2=new foo2;
  $boo =& $boo2; }

afterwards $zoo,$boo2,$boo ought to be one
 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-21 09:54 UTC] stas@php.net
I close this since the matter is not a bug and was discussed on the list. Manual chapter about the matter also added.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 08:00:02 2026 UTC