NYCPHP Meetup

NYPHP.org

[nycphp-talk] Setting up PHP 4 OOP to work in PHP 5 environment

Daniel Convissor danielc at analysisandsolutions.com
Thu Feb 24 11:38:28 EST 2005


On Thu, Feb 24, 2005 at 08:59:02AM -0500, csnyder wrote:
> 
> Out of curiousity, why are you assigning by reference ( =& ) when
> creating the new objects?

Doing so in PHP 4 saves on memory.  For example, in PEAR DB, the connect 
method creates and then returns an object.  As I understand it, in PHP 4, 
if references are not used, the object returned will be a whole new 
copy of the object created inside the method.  But if you assign by 
reference, you get the object created inside the method.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list