From: Arnold C. <arn...@ya...> - 2003-01-17 21:44:12
|
The current version of Phrame does not utilize reference passing as it should. Passing by reference: ... function passObject(&$object) ( $this->object = $object; ) ... Returning by reference: ... function &returnObject() ( return $this->object; ) ... If you have any more questions on references let me know. My development version of Phrame does utilize references throughout. Speaking of the development version, I haven't had much time this week to get it cleaned up to add to the sourceforge cvs. I will hopefully get it ready some time next week. Arnold --- Jason Sweat <jsw...@ya...> wrote: > Just an additional correction on this subject > > Also, where a method returns an object, should it > be: > > > > return &$object; > > really should be > function &ReturnObj() > { > return $this->_Obj; > } > with the & on the function declaration line, not in > the return line. > > Jason > > --- Jason Sweat <jsw...@ya...> wrote: > > Phrame list members, > > > > I have not used PHP's OO extensively. As I > understand, PHP is different than > > most other languages in that objects assignments > are copies of the object > > rather than references to the object by default, > which contrasts with most > > other OO languages (and I believe PHP5 is changing > this behavior). > > > > If this behavior is correct, should most of the > functions in phrame be > > explicitly defined as by reference? > > > > For example, in the Action class, should we: > > > > class Action extends Object > > { > > function perform(&$actionMapping, &$actionForm) > {} > > } > > > > Also, where a method returns an object, should it > be: > > > > return &$object; > > ?? > > > > Does anyone have knowledge in this regard? > > > > Thanks, > > > > Jason > > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > http://mailplus.yahoo.com > > > ------------------------------------------------------- > This SF.NET email is sponsored by: Thawte.com > Understand how to protect your customers personal > information by implementing > SSL on your Apache Web Server. Click here to get our > FREE Thawte Apache > Guide: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en > _______________________________________________ > Phrame-devel mailing list > Phr...@li... > https://lists.sourceforge.net/lists/listinfo/phrame-devel __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |