Re: [nyphp-talk] Change in magic method + reference behavior?

2008-07-19 Thread Michael B Allen
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]; >> >

Re: [nyphp-talk] Change in magic method + reference behavior?

2008-07-19 Thread Jake McGraw
> > 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 >

Re: [nyphp-talk] Change in magic method + reference behavior?

2008-07-19 Thread Michael B Allen
On Sat, Jul 19, 2008 at 9:17 PM, Jake McGraw <[EMAIL PROTECTED]> wrote: > > > On Sat, Jul 19, 2008 at 5:36 PM, Michael B Allen <[EMAIL PROTECTED]> wrote: >> >> I have a class that implements __get which retrieves the named >> attribute from a $this->_data array. In the past I believe I was able >>

Re: [nyphp-talk] Change in magic method + reference behavior?

2008-07-19 Thread Jake McGraw
On Sat, Jul 19, 2008 at 5:36 PM, Michael B Allen <[EMAIL PROTECTED]> wrote: > I have a class that implements __get which retrieves the named > attribute from a $this->_data array. In the past I believe I was able > to do the following: > > $a = &$this->a; Could you post the code for your __get

[nyphp-talk] Change in magic method + reference behavior?

2008-07-19 Thread Michael B Allen
I have a class that implements __get which retrieves the named attribute from a $this->_data array. In the past I believe I was able to do the following: $a = &$this->a; such that modifying array $a would be reflected in the underlying $this->_data array. However currently I'm using a machine