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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you experience an error attempting to use the library in a PHP environment where these modules were not loaded? I'm on the fence about how useful this is, as they are both listed as "bundled and compiled into PHP by default" in the PHP.net documentation.
If we do add this, I'd also be inclined to use actual version checks instead of "
*
". Based on php/php-src@18180bb#diff-17d725bdd470d96051461b6bf27dc116, theext-json
version does appear to be incremented in a semver-like fashion as its API changes with each PHP version. Unfortunately, that isn't the case forext-hash
, which reports "1.0" in PHP versions going back to 5.4 (oldest I tested). That is despite the introduction of new methods in later PHP versions (e.g.hash_equals()
) that should entail a minor version bump.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not experience this kind of error but I thought it was a good addition after reading this blog post.
Concerning the version number, I quote the Composer documentation: