Skip to content

chore(php): fix chr() deprecation in CodedOutputStream.php#24666

Closed
bshaffer wants to merge 1 commit intomainfrom
bshaffer-patch-1
Closed

chore(php): fix chr() deprecation in CodedOutputStream.php#24666
bshaffer wants to merge 1 commit intomainfrom
bshaffer-patch-1

Conversation

@bshaffer
Copy link
Copy Markdown
Contributor

@bshaffer bshaffer commented Dec 1, 2025

Fix a line in CodedOutputStream to get rid of a new deprecation in PHP 8.5:

PHP Deprecated:  chr(): Providing a value not in-between 0 and 255 is deprecated, this is because a byte value must be in the [0, 255] interval. The value used will be constrained using % 256

@bshaffer bshaffer requested a review from a team as a code owner December 1, 2025 19:03
@bshaffer bshaffer requested review from haberman and removed request for a team December 1, 2025 19:03
@copybara-service copybara-service bot closed this in 0297c1b Dec 2, 2025
@VincentLanglet
Copy link
Copy Markdown

Hi @bshaffer, I'm interested by this fix ; is it possible to tag a new release to trigger the sync on https://github.com/protocolbuffers/protobuf-php/blob/master/src/Google/Protobuf/Internal/CodedOutputStream.php side :)

@bshaffer
Copy link
Copy Markdown
Contributor Author

Hi @VincentLanglet ! I believe a release is expected at the end of January. Unfortunately that's the earliest this fix will be delivered. Sorry for the inconvenience

@VincentLanglet
Copy link
Copy Markdown

VincentLanglet commented Dec 15, 2025

Hi @VincentLanglet ! I believe a release is expected at the end of January. Unfortunately that's the earliest this fix will be delivered. Sorry for the inconvenience

Oh. I'm sorry to hear it will be this late :/
This deprecation is writing lot of logs on our log manager which has a cost by line written...
And I'm also interested by #24668

I'll try to find a workaround until the release then

@mariusklocke
Copy link
Copy Markdown

@VincentLanglet You can just exclude deprecation logs by configuring your php.ini. Just read Handling errors with PHP in PHP docs.

@WyriHaximus
Copy link
Copy Markdown

Hi @VincentLanglet ! I believe a release is expected at the end of January. Unfortunately that's the earliest this fix will be delivered. Sorry for the inconvenience

Hey @bshaffer, just for my understanding. You mentioned that fix is expected end of January. Would that but v34.0 of this repo and then translate to v4.34.0 of the PHP package? As I've seen v(4.)33.x releases in January.

@bshaffer
Copy link
Copy Markdown
Contributor Author

bshaffer commented Jan 30, 2026

@WyriHaximus this is now available in google/protobuf:v5.34.0RC1 (see the github release)

The 33.x releases won't have it until I backport the fix. I will submit PRs to do that now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants