|
Posted by Robert Cummings on 09/28/58 11:19
On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote:
> * Michael Stepanov <michaelstepanov@francoudi.com>:
> > 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 = &.
Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
Navigation:
[Reply to this message]
|