Repository navigation
THRIFT-6525: Write bools as true/false in PHP TSimpleJSONProtocol - #4139
Open
slachiewicz wants to merge 1 commit into
Open
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
slachiewicz
marked this pull request as ready for review
November 8, 2026 01:35
sveneld
approved these changes
Nov 8, 2026
Client: php writeBool() went through writeJSONInteger and emitted 1/0, unlike Go, Java and Python (THRIFT-2217), which write the JSON literals. It now writes true/false, quoted when the bool is a map key. TJSONProtocol keeps 1/0 as wire format. The C extension has no simple JSON writer. Tested with the Unit and Integration TSimpleJSONProtocolTest suites. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
slachiewicz
force-pushed
the
THRIFT-6525
branch
from
November 13, 2026 17:04
c43598b to
d6cb222
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: THRIFT-6525
PHP
TSimpleJSONProtocol::writeBool()went throughwriteJSONIntegerand wrote1/0. It now writestrue/false, quoted when the bool is a map key, matching Go and the Java and Python change in THRIFT-2217.TJSONProtocolkeeps1/0as wire format; the C extension has no simple JSON writer.This changes the simple JSON output PHP users see, so it is worth a line in the release notes.
Verified:
vendor/bin/phpunit -c lib/php/phpunit.xml→ the bool cases fail on master ([1]instead of[true]), the 83 simple JSON tests pass here; phpcs and phpstan clean.