|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-31 13:47 UTC] xuefer at 21cn dot com
[2003-02-08 12:53 UTC] moriyoshi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 09:00:01 2025 UTC |
I think it is a bit funny that when returning references from functions you get something looking kind of this in the end: $a = & & $b; That is, I think it would be more logic if a function that is specified to return a reference wouldn't need to be set on the return side to return a reference.. since I doesn't make my self clear, here is as an example what I mean: class a { var $b; function &fc() { return $this->b; } } $c = new a(); // A) $myvar = $c->fc(); ----------------------------------- Now this will not work as I seem would be logical, instead one need to do the last line: // B) $myvar = &$c->fc(); This seems funny.. My logic says that since the function is defined to return a reference it would be enough (A).. no need to do it again like in (B). This is true when passing a reference: somefunc($myvar) will result in passing an reference if the func is defined like function somefunc(&$arg) Is there any chance of a change? Opinions, comments etc. ?