Reply to Re: PHP5 and class inheritance question

Your name:

Reply:


Posted by Steve on 12/19/07 17:17

"Logos" <tyler.style@gmail.com> wrote in message
news:629d3852-7498-474c-9ed7-de84ec3e98d5@e25g2000prg.googlegroups.com...
> On Dec 13, 3:16 pm, Michael Fesser <neti...@gmx.de> wrote:
>> .oO(gosha bine)
>>
>> >in addition to what's already said, there's no need to use references
>> >in php5.
>>
>> At least when working with objects. But nevertheless
>>
>> $foo = new Test();
>> $a = $foo;
>> $b = &$foo;
>>
>> are still different things, even in PHP 5. In some particular situations
>> this might become an issue.
>>
>> Micha
>
> Oooo...errr...ummm...could someone explain how exactly those are
> different when using PHP5, then, please? If everything is done by
> reference for objects, then to me $a and $b both look like pointers to
> an object.
>
> And...are objects always passed by reference to functions in PHP5,
> then?

alright, get ready for a ton of flamage here after i'm done...

first, to be correct and accurate...objects are passed to functions by
reference, objects in arrays are by reference (i.e. when using foreach),
etc., etc.. variable assignment is by value. while $b = &$foo behaves like a
pointer in *every* way, in php there are no true c-style pointers. $b is
just an alias for $foo, a nickname...because of the amphersand (&). make
sense?

[Back to original 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

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