#49772 [NEW]: Cast operators marked as non-associative
| From: | mjomble at gmail dot com | Date: | Sun, 04 Oct 2009 23:00:43 +0000 |
| Subject: | #49772 [NEW]: Cast operators marked as non-associative | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-2878@lists.php.net to get a copy of this message | ||
From: mjomble at gmail dot com
Operating system: Windows
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: Cast operators marked as non-associative
Description:
------------
The operator precedence page (language.operators.precedence.php) lists the
following operators as non-associative:
~ - (int) (float) (string) (array) (object) (bool) @
However, all of these seem to behave like right-associative operators.
Examples:
- - 3 evaluates like -(-3)) = 3
~ ~ 3 evaluates like ~(~3)) = 3
- - - 3 evaluates like -(-(-3))) = -3
~ ~ ~ 3 evaluates like ~(~(~3))) = ~3 = -4
(int) (string) 3 evaluates to integer 3
(string) (int) 3 evaluates to string "3"
It's even possible to use the @ operator more than once in front of a
statement. The additional ones don't really do anything useful, but more
importantly, they don't trigger any parse errors.
--
Edit bug report at http://bugs.php.net/?id=49772&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49772&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49772&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49772&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49772&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49772&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49772&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49772&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49772&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49772&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49772&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49772&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49772&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49772&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49772&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49772&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49772&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49772&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49772&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49772&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49772&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49772&r=mysqlcfg