Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14612 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63165 invoked by uid 1010); 3 Feb 2005 23:20:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63143 invoked from network); 3 Feb 2005 23:20:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2005 23:20:08 -0000 X-Host-Fingerprint: 217.13.4.94 bgo1smout1.broadpark.no Solaris 9 Received: from ([217.13.4.94:60518] helo=bgo1smout1.broadpark.no) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id 5E/4F-10528-7A1B2024 for ; Thu, 03 Feb 2005 18:20:08 -0500 Received: from bgo1sminn1.broadpark.no ([217.13.4.93]) by bgo1smout1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IBC003WMZ4AAK70@bgo1smout1.broadpark.no> for internals@lists.php.net; Fri, 04 Feb 2005 00:12:10 +0100 (CET) Received: from pc ([80.203.129.71]) by bgo1sminn1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with SMTP id <0IBC00F73ZH59ZB0@bgo1sminn1.broadpark.no> for internals@lists.php.net; Fri, 04 Feb 2005 00:19:54 +0100 (CET) Date: Fri, 04 Feb 2005 00:19:51 +0100 To: internals@lists.php.net Message-ID: <04f301c50a46$dd12ea40$0300000a@pc> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Mailer: Microsoft Outlook Express 6.00.2800.1437 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <00dd01c50a22$523a3780$0300000a@pc> Subject: Re: [PHP-DEV] PHP 5.1 From: tslettebo@broadpark.no (=?iso-8859-1?Q?Terje_Sletteb=F8?=) > From: "Stanislav Malyshev" > TS>>across, given what what operator overloading is about). As I've pointed out > TS>>in other postings in this thread, operator overloading is about much more > TS>>than "just" "syntactic sugar". In C++, for example, it enables important > > I think you did not succeed in proving this point. You keep bringing > examples of how useful it is in C++ - which can be interesting to debate, > but is entirely irrelevant to PHP, since PHP is different from C++ on many > levels and tasks that are solved with operators in C++ often even not > exist in PHP (like "smart pointers", etc.). I still fail to see how it can > be really useful - in terms of making something that was very hard to do > before easy to do now - beyond they syntax sugar value. It's a little hard to bring examples of PHP usage of it, since it doesn't exist there, and therefore we have no experience with it. However, I saw someone post a patch about it, enabling overloaded operators in PHP. > TS>>things such as function objects (being able to pass an object to a function, > TS>>for example, and have it behave as a function, enabling functional > TS>>programming, as well). This is not possible (possibly without jumping > TS>>through major hoops) in PHP. > > Surely it is. Via __call, for example, which is no worse than operator(). > Yes, you could not write it the same syntax as C++ - so what? An advantage of function objects in C++ is that they can be used where functions are expected. Nevertheless, there are some features that can be used to get something similar, such as create_function(): > TS>>However, I see from this and other threads, that there's not much chance of > TS>>evolution of PHP to support more "advanced" features (which are common in > > There's a lot of chance for PHP to evolve, but if you mean by it that any > feature that you might like would be in without scrutiny - yes, there's > little chance for that. By all means, I'm all for scrutiny. :) That's why I bring it up, to possibly stimulate some discussion about it, and, yes, scrutiny. I may learn at least as much from this as anyone else. Simply put, I'd like to know what the arguments for and against are, so that, yes, they may be scrutinised. > TS>>other scripting languages, as mentioned). It seems basic OO support is about > TS>>the only thing the PHP community can handle when it comes to expressiveness > TS>>in the language. Oh, well. > > It means you probably won't see in PHP every feature that your favorite > other language has. So what? Your favorite other language probably doesn't > have all the features of PHP. The new features for PHP should be checked > if they are good for PHP and can be implemented consistently and > efficiently in PHP. True. I see what I wrote above was rather harsh. I guess I in a way hoped that someone would tell me I'm wrong. :) And that the PHP community _is_ interested in improvements in the language (any improvements, these are just some possibilities), and that possibly what I suggest is not what is found to be most interesting, but feature xyz may be, or library x. That would have been fine. I'm here to learn, too. So, ok, I acknowledge that the community _is_ interested in improvements in the language, and therefore take back the paragraph you quote above (and any statements like it). Regards, Terje