rfc:string-bitwise-shifts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:string-bitwise-shifts [2014/04/17 11:51] daverandomrfc:string-bitwise-shifts [2021/03/27 14:34] (current) – Move to inactive ilutov
Line 3: Line 3:
   * Date: 2014-04-15   * Date: 2014-04-15
   * Author: Chris Wright, daverandom@php.net   * Author: Chris Wright, daverandom@php.net
-  * Status: Draft+  * Status: Inactive
   * First Published at: https://wiki.php.net/rfc/string-bitwise-shifts   * First Published at: https://wiki.php.net/rfc/string-bitwise-shifts
  
Line 10: Line 10:
  
 ===== Proposal ===== ===== Proposal =====
-Currently, bitwise shift operations on strings are performed by converting the string to an integer and performing the operation on the result and returning an integer. +Currently, bitwise shift operations on strings are performed by converting the string to an integer and returning an integer. This behaviour does not match that of the other bitwise operators when they are used with string operands, as these perform the operation on a byte-by-byte basis, and return a string.
- +
-This behaviour does not match that of the other bitwise operators when they are used with string operands, as these perform the operation on a byte-by-byte basis, and return a string.+
  
 This RFC proposes that the behaviour of the bitwise shift operators be altered, such that when the left operand is a string the shift operation is performed on the byte values of the string's characters, carrying bits between bytes as necessary. The will effectively treat the string as an arbitrarily large integer. This RFC proposes that the behaviour of the bitwise shift operators be altered, such that when the left operand is a string the shift operation is performed on the byte values of the string's characters, carrying bits between bytes as necessary. The will effectively treat the string as an arbitrarily large integer.
  
-// TODO: Add some example use cases+TODO: Add some example use cases
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/string-bitwise-shifts.1397735519.txt.gz · Last modified: 2017/09/22 13:28 (external edit)