On Sat, Jul 19, 2008 at 11:55 PM, Michael B Allen <[EMAIL PROTECTED]> wrote:

> On Sat, Jul 19, 2008 at 10:55 PM, Jake McGraw <[EMAIL PROTECTED]> wrote:
> >
> >> > 1. You're using "Call-time pass-by-reference" by marking your return
> >> > value
> >> > with an ampersand, try changing your code to this:
> >> >
> >> > public function __get($field) {
> >> >   return &$this->_data[$field];
> >> > }
> >>
> >> But I don't want the default behavior to be to return a reference.
> >>
> >> Mike
> >
> > Ah, well, you're setting yourself up for some fun debugging later on,
> it's
> > probably best not to mix and match pass by reference/value, which is why
> I
> > think the PHP group depreciated the ability to do call-time pass by
> > reference. IMO, whether a function returns a reference or a value should
> be
> > part of the object method definition, not on the basis of the way the
> > function was called.
>
> I did not use, do not use and do not want to use call-time
> pass-by-reference.


> The code in question was "&$this->a" where $this is "magic" so it
> should, in theory, behave as though "a" was a real object member.


Ahhhhh... sorry, that's what I get for having a programming conversation
late on a Saturday night.

- jake
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to