Bug #68562 [Opn->Csd]: bitwise operators in conjunction with strings
| From: | stas@php.net | Date: | Sun, 07 Dec 2014 20:44:13 +0000 |
| Subject: | Bug #68562 [Opn->Csd]: bitwise operators in conjunction with strings | ||
| References: | 1 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-579@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68562&edit=1
ID: 68562
Updated by: stas@php.net
Reported by: rstoll at tutteli dot ch
Summary: bitwise operators in conjunction with strings
-Status: Open
+Status: Closed
Type: Bug
Package: PHP Language Specification
Operating System: Windows
PHP Version: 5.6.3
-Assigned To:
+Assigned To: stas
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2014-12-07 16:12:07] rstoll at tutteli dot ch
Description:
------------
The spec is not correct/complete for certain bitwise operations in conjunction with strings.
Consider the following:
http://3v4l.org/fR1pE
For instance, the spec does not mention anything about the ~ in conjunction with strings:
https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#unary-arithmetic-operators
The section about bitwise operator mentions that the return type would be int and that the operands
would be converted to integers, which is both wrong for strings:
https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#bitwise-inclusive-or-operator
etc.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68562&edit=1