Repository navigation
Conversation
Member
|
I dont' think such a behavior change is acceptable for stable branches (but is fine for next) |
The "-n" and "-c" flags serve essentially the same purpose, to indicate which ini file should be used. The -c flag lets you name an ini file explicitly, while -n means that no ini file should be used. Typically, argument parsers will override earlier occurrences of a flag with later ones. Later occurrences of -c do indeed override earlier -c flags, but if you specify -n after -c, the -n is essentially ignored; the ini file passed to -c is loaded anyway. After updating ext/standard/tests/ini_info/php_ini_loaded_file.phpt to support TEST_PHP_EXTRA_ARGS, that test fails if the extra args include -c. In particular, it fails "make test". This commit updates the argument parser so that subsequent -n override any existing -c flags, fixing the tests.
orlitzky
force-pushed
the
n-and-c-flag-precedence
branch
from
November 12, 2026 12:56
7c48f10 to
fe10ea1
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.
The
-nand-cflags serve essentially the same purpose, to indicate which ini file should be used. The-cflag lets you name an ini file explicitly, while-nmeans that no ini file should be used.Typically, argument parsers will override earlier occurrences of a flag with later ones. Later occurrences of -c do indeed override earlier
-cflags, but if you specify-nafter-c, the-nis essentially ignored; the ini file passed to-cis loaded anyway.After updating ext/standard/tests/ini_info/php_ini_loaded_file.phpt to support
TEST_PHP_EXTRA_ARGS, that test fails if the extra args include-c. In particular, it fails "make test". This commit updates the argument parser so that subsequent-noverride any existing-cflags, fixing the tests.See also:
make teston Fedora (ARM Apple M2) #25237