On Tue, 4 May 2010, Daniel Convissor wrote: > Hi Derick: > > On Tue, May 04, 2010 at 03:50:36PM +0100, Derick Rethans wrote: > > On Tue, 4 May 2010, Daniel Convissor wrote: > > > > > Revision: http://svn.php.net/viewvc?view=revision&revision=298971 > > > > > > Log: > > > Procedural methods operate on object by reference. > > > > Uh? That's nonsense. They don't operator on a reference of the object. > > Objects are not passed by a real reference here. > > While the C source code is not using references (I haven't looked, but I > believe you), they sure act like they are. The object passed as the > parameter gets modified. For example: > > $date = date_create(); > date_date_set($date, 2001, 2, 3); > echo date_format($date, 'Y-m-d'); // 2001-02-03 > > It seems the documentaiton should cover behavior, not the internal > technical structure. If people disagree, is there a better way to > docment this?
There is still a difference in userland between: function tralala ( $foo ); and function tralala ( &$foo ); with $foo being fed an object. Objects are passed by a handle, so it looks like a reference. It's the same for *every* object, and AFAIK the refence bit is not used there in the XML. Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug
