|
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]
|