Re: Re: Strange notation to create object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Robert Cummings <robert@xxxxxxxxxxxxx> :
> On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote:
> > * Michael Stepanov <michaelstepanov@xxxxxxxxxxxxx> :
> > > 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();
> > >
> > > Can anyone explain me meaning of *&*?
> > 
> > & is used to create references -- kind of like \ in perl. 
> > 
> > The above notation is unnecessary when developing in PHP5, as objects in
> > PHP5 are passed by reference by default. However, in PHP4, this was
>
> Not entirely, there's still a subtle difference in PHP5 between
> assigning an object with = versus assigning with = &.

Would you mind explaining the difference? I've seen nothing in the docs,
to indicate that assigning objects with =& in PHP5 is necessary, or even
desired. My experience with PHP5 hasn't shown this either. I'd be
interested to know to what you refer.

-- 
Matthew Weier O'Phinney           | WEBSITES:
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org
mailto:matthew@xxxxxxxxxx         | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux