Repository navigation
Replace boolean inputs in type juggling tests - #25947
Open
theodorejb wants to merge 1 commit into
Open
theodorejb wants to merge 1 commit into
theodorejb wants to merge 1 commit into
Conversation
theodorejb
requested review from
DanielEScherzer,
bukka,
devnexen and
kamil-tekiela
as code owners
November 30, 2026 15:27
kamil-tekiela
approved these changes
Nov 30, 2026
kamil-tekiela
left a comment
Member
There was a problem hiding this comment.
Approved for mysqli only.
Girgias
reviewed
Nov 30, 2026
Girgias
left a comment
Member
There was a problem hiding this comment.
Didn't have the time to look at ext/standard yet, but at one point in the past I tried to clean those tests up and didn't get round to it.
But the rest LGTM.
theodorejb
force-pushed
the
replace-bool-test-inputs
branch
from
November 30, 2026 16:15
2c17ad9 to
94d6fc4
Compare
Many older tests include booleans in their lists of inputs for int, float, or string parameters, or other scalars in their lists of inputs for bool parameters. Each of these inputs is now replaced with the value it was converted to (0, 0.0, or "" for false, and 1, 1.0, or "1" for true), or removed when the test already has an input which converts to the same value. The functions are called with the same values as before, so the tests keep their coverage without relying on implicit conversions to or from bool. Booleans which are not converted, such as array elements joined by implode() or $res_arr values in tempnam_variation3-win32.phpt, are kept. The fscanf() tests which write booleans to a file as test data now convert them to strings explicitly. call_user_func_strict_arginfo_check.phpt passes an int instead of false to strlen(), so it still covers a weak mode conversion. The get_cfg_var(), proc_nice(), and imageantialias() tests which only passed booleans are removed, as the values they converted to are covered by the other tests of these functions, with an empty string case added to get_cfg_var_variation7.phpt. The ReflectionClass::getConstant(), hasConstant(), hasMethod(), and hasProperty() tests of invalid arguments are also removed, as they only test parameter parsing.
theodorejb
force-pushed
the
replace-bool-test-inputs
branch
from
December 1, 2026 03:43
94d6fc4 to
986df7b
Compare
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.
Split out of #25889 per request, so it can be reviewed separately.
Many older tests include booleans in their lists of inputs for
int,float, orstringparameters, or other scalars in their lists of inputs for bool parameters. Each of these inputs is now replaced with the value it was converted to (0,0.0, or""forfalse, and1,1.0, or"1"fortrue), or removed when the test already has an input which converts to the same value. The functions are called with the same values as before, so the tests keep their coverage without relying on implicit conversions to or frombool. Booleans which are not converted, such as array elements joined byimplode()or$res_arrvalues intempnam_variation3-win32.phpt, are kept.The
fscanf()tests which write booleans to a file as test data now convert them to strings explicitly.call_user_func_strict_arginfo_check.phptpasses anintinstead offalsetostrlen(), so it still covers a weak mode conversion. Theget_cfg_var(),proc_nice(), andimageantialias()tests which only passed booleans are removed, as the values they converted to are covered by the other tests of these functions, with an empty string case added toget_cfg_var_variation7.phpt. TheReflectionClass::getConstant(),hasConstant(),hasMethod(), andhasProperty()tests of invalid arguments are also removed, as they only test parameter parsing.