rfc:string-bitwise-shifts

This is an old revision of the document!


PHP RFC: Normalize string bitwise shifts

Introduction

This RFC proposes that the behaviour of bitwise shift operations on strings be altered to match the behaviour of bitwise shifts on integers.

Proposal

TODO

Backward Incompatible Changes

Existing code that relies on the current behaviour will no longer produce the originally expected result. This can be easily resolved by explicitly casting the left operand to an integer.

Proposed PHP Version(s)

As this is a backwards-incompatible change, this RFC targets PHP 6.

Open Issues

Should right shifts shift copies of the left-most bits on, or always shift cleared bits?

Unaffected PHP Functionality

Only bitwise shifts in user land where the left operand is a string are affected.

Proposed Voting Choices

Yes or no.

Patches and Tests

A WIP patch can be seen on Github.

References

Rejected Features

None so far.

rfc/string-bitwise-shifts.1397520022.txt.gz · Last modified: 2017/09/22 13:28 (external edit)