[thelist] another php question: object reference syntax
Michael Kimsal
michael at tapinternet.com
Wed Jul 17 16:38:00 CDT 2002
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?
>
Not in PHP. PHP requires objects to use the -> no matter what.
Consider that Java compiles and PHP is (generally) interpreted. Having
to determine if a . or -> are appropriate is going to take a bit
longer. I think that's why there's a strict separation of thingys
(. and -> and whatever else).
Consider also that . is used for variable concatenation. That is
easier (and probably used more often) than object property/method
accessing.
Michael Kimsal
http://www.phpappserver.com
734-480-9961
More information about the thelist
mailing list