RE: [PHP] Re: Strange notation to create object

2005-07-12 Thread Ford, Mike
On 24 June 2005 15:03, Jason Barnett wrote: > Robert Cummings wrote: > ... > > > > > > There's a difference between a reference to a reference and a copy > > of a reference *hehehe*. > > > > Cheers, > > Rob. > > Dear diary: jackpot! > > Now that makes sense. And am I correctly filling in th

Re: [PHP] Re: Strange notation to create object

2005-06-24 Thread Kevin L'Huillier
On 24/06/05, Jason Barnett <[EMAIL PROTECTED]> wrote: > OK I'm pretty clear on it, but now I wonder: is variable assignment (=) > the only place where the Zend Engine will copy a reference instead of > reference the reference? In PHP 4, function arguments work the same way. Unless you use the ref

Re: [PHP] Re: Strange notation to create object

2005-06-24 Thread Jason Barnett
Robert Cummings wrote: ... This is intentional behaviour, there are times when you want a copy of a reference and there are times when you want a reference to a reference. For instance consider the following: $foo1 = $foo2 = $foo3 = new a(); $foo2 = new b(); If these were references to referen

Re: [PHP] Re: Strange notation to create object

2005-06-24 Thread Robert Cummings
On Fri, 2005-06-24 at 14:09, Jason Barnett wrote: > Robert Cummings wrote: > ... > > > > Yeah, *grin*. And on that note, there are times when you will actually > > want $foo = &new SomeClass(); versus $foo = new SomeClass(); since > > assigning by reference will break any previous references -- so

Re: [PHP] Re: Strange notation to create object

2005-06-24 Thread Jason Barnett
Robert Cummings wrote: ... Yeah, *grin*. And on that note, there are times when you will actually want $foo = &new SomeClass(); versus $foo = new SomeClass(); since assigning by reference will break any previous references -- something I forgot to mention to Matthew Weier when he challenged the

Re: [PHP] Re: Strange notation to create object

2005-06-24 Thread Matthew Weier O'Phinney
* Robert Cummings <[EMAIL PROTECTED]> : > On Fri, 2005-06-24 at 10:02, Jason Barnett wrote: > > Robert Cummings wrote: > > ... > > > There's a difference between a reference to a reference and a copy of a > > > reference *hehehe*. > > > > Now that makes sense. And am I correctly filling in the bl

Re: [PHP] Re: Strange notation to create object

2005-06-24 Thread Robert Cummings
On Fri, 2005-06-24 at 10:02, Jason Barnett wrote: > Robert Cummings wrote: > ... > > > > > > There's a difference between a reference to a reference and a copy of a > > reference *hehehe*. > > > > Cheers, > > Rob. > > Dear diary: jackpot! > > Now that makes sense. And am I correctly filling i

Re: [PHP] Re: Strange notation to create object

2005-06-24 Thread Jason Barnett
Robert Cummings wrote: ... There's a difference between a reference to a reference and a copy of a reference *hehehe*. Cheers, Rob. Dear diary: jackpot! Now that makes sense. And am I correctly filling in the blanks when I guess that $foo3 = $aObj is merely copying the reference instead o

Re: [PHP] Re: Strange notation to create object

2005-06-24 Thread vieonet forums
gt; Cc: "PHP-General" Sent: Thursday, June 23, 2005 11:50 PM Subject: Re: [PHP] Re: Strange notation to create object On Thu, 2005-06-23 at 15:28, Matthew Weier O'Phinney wrote: * Robert Cummings <[EMAIL PROTECTED]> : > On Thu, 2005-06-23 at 13:36, Matthew Weier O'P

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Evert | Rooftop Solutions
Robert Cummings wrote: On Thu, 2005-06-23 at 13:36, Matthew Weier O'Phinney wrote: * Robert Cummings <[EMAIL PROTECTED]> : On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote: The above notation is unnecessary when developing in PHP5, as objects in PHP5 are passed by ref

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Robert Cummings
On Thu, 2005-06-23 at 21:44, Matthew Weier O'Phinney wrote: > * Jason Barnett <[EMAIL PROTECTED]> : > > Matthew Weier O'Phinney wrote: > > ... > > > This doesn't demonstrate what the OP was talking about, which is initial > > > assignment of an object using a reference operator. The results of this

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Matthew Weier O'Phinney
* Jason Barnett <[EMAIL PROTECTED]> : > Matthew Weier O'Phinney wrote: > ... > > This doesn't demonstrate what the OP was talking about, which is initial > > assignment of an object using a reference operator. The results of this > > make perfect sense to me -- the references are passed exactly as

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Matthew Weier O'Phinney
* Robert Cummings <[EMAIL PROTECTED]> : > On Thu, 2005-06-23 at 15:28, Matthew Weier O'Phinney wrote: > > * Robert Cummings <[EMAIL PROTECTED]> : > > > On Thu, 2005-06-23 at 13:36, Matthew Weier O'Phinney wrote: > > > > * Robert Cummings <[EMAIL PROTECTED]> : > > > > > On Thu, 2005-06-23 at 11:32,

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Robert Cummings
On Thu, 2005-06-23 at 15:28, Matthew Weier O'Phinney wrote: > * Robert Cummings <[EMAIL PROTECTED]> : > > On Thu, 2005-06-23 at 13:36, Matthew Weier O'Phinney wrote: > > > * Robert Cummings <[EMAIL PROTECTED]> : > > > > On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote: > > > > > The above

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Jason Barnett
Matthew Weier O'Phinney wrote: ... This doesn't demonstrate what the OP was talking about, which is initial assignment of an object using a reference operator. The results of this make perfect sense to me -- the references are passed exactly as I would expect. But not exactly as I would expe

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Matthew Weier O'Phinney
* Robert Cummings <[EMAIL PROTECTED]> : > On Thu, 2005-06-23 at 13:36, Matthew Weier O'Phinney wrote: > > * Robert Cummings <[EMAIL PROTECTED]> : > > > On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote: > > > > The above notation is unnecessary when developing in PHP5, as objects in > > >

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Robert Cummings
On Thu, 2005-06-23 at 13:36, Matthew Weier O'Phinney wrote: > * Robert Cummings <[EMAIL PROTECTED]> : > > On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote: > > > The above notation is unnecessary when developing in PHP5, as objects in > > > PHP5 are passed by reference by default. However

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Matthew Weier O'Phinney
* Robert Cummings <[EMAIL PROTECTED]> : > On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote: > > * Michael Stepanov <[EMAIL PROTECTED]> : > > > Usually, I develop on Perl. But my current task pushes me to start use > > > PHP. Generally, it's great but sometimes I'm a little bit confused. >

Re: [PHP] Re: Strange notation to create object

2005-06-23 Thread Robert Cummings
On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote: > * Michael Stepanov <[EMAIL PROTECTED]>: > > Usually, I develop on Perl. But my current task pushes me to start use > > PHP. Generally, it's great but sometimes I'm a little bit confused. > > For example, recently I've found a strange not

[PHP] Re: Strange notation to create object

2005-06-23 Thread Matthew Weier O'Phinney
* Michael Stepanov <[EMAIL PROTECTED]>: > Usually, I develop on Perl. But my current task pushes me to start use > PHP. Generally, it's great but sometimes I'm a little bit confused. > For example, recently I've found a strange notation of creation of PHP > objects: > > $obj = & new SomeObject(); >