Reply to Re: PHP5 and class inheritance question

Your name:

Reply:


Posted by Jerry Stuckle on 12/31/07 02:16

Steve wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:mJidnRYAhdsKJO7anZ2dnUVZ_sbinZ2d@comcast.com...
>> Steve wrote:
>>> "Michael Fesser" <netizen@gmx.de> wrote in message
>>> news:0hlim3hgb5p7ifm2o13pjm6q4l0q5jhiim@4ax.com...
>>>> .oO(Logos)
>>>>
>>>>> On Dec 13, 3:16 pm, Michael Fesser <neti...@gmx.de> wrote:
>>>>>
>>>>>> 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.
>>>>> 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.
>>>> Don't confuse pointers with references, they are entirely different
>>>> things. PHP doesn't know pointers.
>>>>
>>>> And correctly spoken objects in PHP 5 are _not_ passed by reference (at
>>>> least it's not what PHP calls a reference), even if it's still mentioned
>>>> that way on many websites. But it's wrong.
>>>>
>>>> Internally objects are represented by a handle (a simple number), which
>>>> is what is moved around when you assign objects to variables, copy them
>>>> or pass them to a function. You're never working directly with the
>>>> object itself, but with its handle. Of course usually you won't notice
>>>> that, because it's handled transparently by PHP.
>>> michael, for people who come from a c/c++ background, what you've
>>> described is *exactly* a pointer. the only difference in php is that
>>> rather than the handle pointing to a memory address where information is
>>> stored, this php handle points to a symbol table entry where information
>>> is stored.
>>>
>> Wrong again, Stevie. A C++ pointer is not the same as a C++ reference.
>> And C doesn't have references, just as PHP doesn't have pointers.
>>
>>> in php, a reference (or byref) behaves *IDENTICALLY* to a c/c++ pointer.
>>> there are somethings that you cannot do with this reference in php that
>>> you could in other languages, however, the nature of the beast is the
>>> same. i know that a reference in php is really just an alias of the
>>> symbol table entry, but really that just seems a matter of symantics to
>>> me. i don't care where things are stored at such a low level when i'm
>>> writing in a scripting language. i care about behaviors.
>>>
>> Wrong again. They behave much differently.
>
> read, jerry, read. show me how in *PHP* the behavior is different. you've
> tried before and failed. i'm not talking about the differences in c/c++/c#
> (as they *are* different there)...we're talking about php.
>
>
>

Stoopid. Show me where PHP has pointers. It doesn't.

And you're the one who claimed that references and pointers behave
identically in C/C++. Wrong again.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[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

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