You are here: Re: [PHP] Strange notation to create object « PHP « IT news, forums, messages
Re: [PHP] Strange notation to create object

Posted by Rory Browne on 10/02/45 11:19

It's in the manual.

PHP4
$obj = new SomeObject() would create a SomeObject, and assign it by
value to $obj. $obj would be a copy of the one created. by the new
SomeObject. & makes it assign by reference.

PHP5
In PHP5 Objects are assigned by reference anyway so the & doesn't matter.


On 6/23/05, Michael Stepanov <michaelstepanov@francoudi.com> wrote:
> Dear all,
>
> 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 *&*?
>
> Thanks in advanced
>
> --
> Best regards,
> Michael Stepanov
> Perl/Linux Developer
> Francoudi & Stephanou Ltd
> Tel: +357 25-867154
> Email: michaelstepanov@francoudi.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация