php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68562 bitwise operators in conjunction with strings
Submitted: 2014-12-07 16:12 UTC Modified: 2014-12-07 20:44 UTC
From: rstoll at tutteli dot ch Assigned: stas (profile)
Status: Closed Package: PHP Language Specification
PHP Version: 5.6.3 OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rstoll at tutteli dot ch
New email:
PHP Version: OS:

 

 [2014-12-07 16:12 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-12-07 20:44 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2014-12-07 20:44 UTC] stas@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC