You are here: Re: new Object()->function() ? « PHP Programming Language « IT news, forums, messages
Re: new Object()->function() ?

Posted by Jerry Stuckle on 10/02/07 19:55

Mtr wrote:
> On Tue, 02 Oct 2007 17:07:10 +0200, Michael Fesser <netizen@gmx.de> wrote:
>
>> The object is dereferenced. From the manual:
>>
>> | An operator is something that you feed with one or more values (or
>> | expressions, in programming jargon) which yields another value (so
>> | that the construction itself becomes an expression).
>
> quoting the manual can only try to indicate what the authors of PHP say.
> That is not any proof that it really is an operator. If they say that the
> sun is blue, would you believe that, too?
>
> The fact is that no operation is being performed, and so "->" is not an
> operator in the conventioned use of the term.
>

But there IS an operation being performed. You are dereferencing the
object. And it has precedence (pretty high) and associativity (left to
right).

> In another language, Object.property would not indicate that the dot is an
> operator of any kind. The author(s) of PHP shot themselves in the foot
> early on when they decided to use the the dot for string concatenation
> rather than the same plus sign that nearly everybody else uses. So now they
> have to use the clunky '->' where they should be using a dot. It still just
> denotes that a method or variable belongs to the object.

And in another language (specifically C++ or Java), the dot is an
operator.

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

 

Navigation:

[Reply to this 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

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