You are here: Re: =& when creating new object « PHP Programming Language « IT news, forums, messages
Re: =& when creating new object

Posted by Joe on 09/24/07 20:45

Steve, thats a great explanation, thank you.

I have a question however. The WIKI example I'm looking at calls =&
new Wakka.... on something that has not been defined yet. It is making
a reference to something that doesnt exist? isnt it?



On Sep 24, 9:31 pm, "Steve" <no....@example.com> wrote:
> "Michael Fesser" <neti...@gmx.de> wrote in message
>
> news:d57gf3p144kqni8fvaan5kra2f2d9vntbj@4ax.com...
>
> > .oO(Joe)
>
> >>I am just starting to use Object Oriented PHP coding, and I am seeing
> >>quite often the following (this example taken from a wiki):
>
> >>$wakka =& new Wakka($wakkaConfig);
>
> > It was required in PHP 4 to make sure that $wakka will be assigned a
> > reference to the created object instead of just a copy of it, which
> > could lead to problems in some situations.
>
> > If you just start with OOP in PHP, then you should do this with PHP 5,
> > where objects are always passed as references by default and you don't
> > have to worry about this issue anymore (at least not for objects).
>
> you've implied that byVal and byRef are restricted only to php versions and
> applied only to objects. i'm sure that's not the message you want to get
> across here, right?

 

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

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