#49249 [WFx]: Call-time pass-by-reference deprecated -> undeprecate
| From: | ile at dennisgiese dot de | Date: | Fri, 14 Aug 2009 19:43:26 +0000 |
| Subject: | #49249 [WFx]: Call-time pass-by-reference deprecated -> undeprecate | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-141059@lists.php.net to get a copy of this message | ||
ID: 49249
User updated by: ile at dennisgiese dot de
Reported By: ile at dennisgiese dot de
Status: Wont fix
Bug Type: Feature/Change Request
Operating System: Win XP Sp3
PHP Version: 5.3.0
New Comment:
maybe but think of php functions like array_walk! you can turn them off
then as well...
don't tell me what is wrong-reasoned or not. just look at what is
wrong-reasoned from YOUR site. i just tool that simple example since it
was the closest i had used.
just telling me ONE single reason, WHY it should be turned off!
it is nonsense - and, as stated above - throws php back to stoneage
since EVERY other "good" programming language i know, make use of
call-time pass-by-reference.
and i won't look up general lists for reasons "why" because there are
no reasons why to turn that off.
Previous Comments:
------------------------------------------------------------------------
[2009-08-14 08:48:21] derick@php.net
You're using references for all the wrong reasons here as well. Please
refer to the php-general list as to why.
------------------------------------------------------------------------
[2009-08-14 05:20:52] ile at dennisgiese dot de
Description:
------------
Please undreprecate Call-Time pass-by-reference, since it is a fully
supported and used way of programming style in almost EVERY serious and
"big" language!
Reproduce code:
---------------
If you have any kind of class or stack of functions you surely want to
keep lines of code as short as possible. on the other hand you surely
don't want to "copy" your variables just to call a function...
example:
building an XML document, while using a (sub)function in order to
create only sligthly different paths:
private function _prepareRequest()
{
//[some other code]
$this->_StoreInterval("from",&$xmlwriter,$this->startdate);
$this->_StoreInterval("to",&$xmlwriter,$this->enddate);
//[some other code]
}
private function _StoreInterval($kind,&$xmlwriter,$date)
{
$xmlwriter->startElement($kind);
$xmlwriter->writeElement("day",date("d",$date));
$xmlwriter->writeElement("month",date("m",$date));
$xmlwriter->writeElement("year",date("Y",$date));
$xmlwriter->writeElement("hour",date("H",$date));
$xmlwriter->endElement();
}
Expected result:
----------------
in 5.3.0 this still works, but got an warning because this is
"deprecated"...
Actual result:
--------------
actually this should be working anyway, since i don't want to waste
memory just to copy and paste back results from this subfunction.
if this won't work it makes - to some extend - building functions
useles.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49249&edit=1