#46668 [NEW]: Changing static class operator to "->"
| From: | nightstorm at tlen dot pl | Date: | Tue, 25 Nov 2008 17:09:13 +0000 |
| Subject: | #46668 [NEW]: Changing static class operator to "->" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-131309@lists.php.net to get a copy of this message | ||
From: nightstorm at tlen dot pl
Operating system:
PHP version: 6CVS-2008-11-25 (CVS)
PHP Bug Type: Feature/Change Request
Bug description: Changing static class operator to "->"
Description:
------------
Hi everyone,
I've recently read about some controversies concerning the new namespace
operator and I noticed a possible solution which I want to share with you.
Unfortunately, it breaks the backward compatibility.
The idea is to use "->" both for normal object and static class element
access, as id does not introduce any ambiguity and can be resolved directly
by the lexical parser:
$variable->field - object call
$variable->method() - object call
ClassName->field - static call
ClassName->method() - static call
ClassName->method()->method2()->field - first one is static, the rest are
object calls.
Now "::" can be used as the namespace access operator. I use the same
rules in my template engine to convert the object calls to the PHP syntax
and I'm pretty sure they are correct.
--
Edit bug report at http://bugs.php.net/?id=46668&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46668&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46668&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46668&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46668&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46668&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=46668&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46668&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46668&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46668&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46668&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46668&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46668&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46668&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46668&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46668&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46668&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46668&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46668&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46668&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46668&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46668&r=mysqlcfg