[thelist] another php question: object reference syntax

Tom Dell'Aringa pixelmech at yahoo.com
Wed Jul 17 16:16:01 CDT 2002


You're right in that Java does away with pointers as understood in C,
at least that I understand. But a reference still has a memory
address also. I don't know enough Java to explain any more of it, I
know it can get sticky when you do things with objects.

I primarily just want to know if I can use the dot syntax! Anyone?

Tom
--- Jonathan_A_McPherson at rl.gov wrote:
> > Ok, that makes sense. I seem to remember this talk about pointers
> > when going through a Java class, and you often see those caveats
> in
> > Java books (at least that I have read.) Coming from
> Java/JavaScript
> > it seemed odd.
> >
> > So - I CAN use dot syntax, but if I make a pointer, I have to use
> ->
> > correct?
>
> I don't know a great deal about Java. If I recall correctly, it
> doesn't have
> pointers in the C sense of the word. In C, a pointer is a memory
> address.
> Java, attempting to do away with such down-to-the-hardware
> specifics to make
> a more abstract VM, abandoned memory pointers.
>
> I suspect that Java and PHP have object references, and by this I
> mean an
> object that is really just a reference to a different object. For
> instance:
>
> Copy object (use .)
>
> +---+     +---+
> | x |     | y |
> +---+     +---+
>
> Reference object (use ->)
>
> +---+
> | x | <---- y
> +---+
>
> I don't know enough PHP to know which operations generate actual
> copies and
> which operations generate references. PHP wizards -- I know you're
> out
> there!
>
> --
> Jonathan McPherson, LMIT/SD&I
> Software Engineer & Web Systems Analyst
> email / jonathan_a_mcpherson at rl dot gov
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com



More information about the thelist mailing list