ID:               49249
 Updated by:       der...@php.net
 Reported By:      ile at dennisgiese dot de
-Status:           Open
+Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: Win XP Sp3
 PHP Version:      5.3.0
 New Comment:

You're using references for all the wrong reasons here as well. Please
refer to the php-general list as to why.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to