Doubt on why some syntaxis is not used for PHP
| From: | Manuel Aude | Date: | Sat, 13 Jun 2009 05:57:51 +0000 |
| Subject: | Doubt on why some syntaxis is not used for PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-293997@lists.php.net to get a copy of this message | ||
I'm gonna guess that there might be some syntaxis problems or something,
since I would guess the following make sense to the PHP language.
Arrays: Since the + operator already gives the union of two arrays, why
isn't the - operator for differences and | for intersections? I would find
those to be rather natural and actually easy to implement.
Classes: I was also wondering why the static methods of a class use the ::
syntaxis. After all, I don't see what's the problem with also using -> for
static calls. Just by adding MyClass->staticMethod(), the whole problem of
namespaces and :: as separator would seem to be made a bit easier.
Just some questions =) I'm not here to say that things are wrong, just
wondering why they weren't thought to be the other way. Again, there might
be some syntaxis problem with the parser that I haven't thought so far.
Regards, Mamsaac