Skip to content

Commit a2b7ef3

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Fix GH-9670: List -C and -q in the CLI help
2 parents bec9a00 + b4539c0 commit a2b7ef3

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

‎NEWS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ PHP NEWS
4141
- CLI:
4242
. Fixed bug GH-24697 (PHP_HTTP_PARSER_STRICT build option doesn't work).
4343
(ndossche, devnexen)
44+
. Fixed bug GH-9670 (List -C and -q in the CLI help). (Juan Versolato Lopes)
4445

4546
- Curl:
4647
. Fix use-after-free of CURLOPT_STDERR stream on cloned curl handle.

‎sapi/cli/php_cli.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ static void php_cli_usage(char *argv0)
484484
"\n"
485485
" -a Run as interactive shell (requires readline extension)\n"
486486
" -c <path>|<file> Look for php.ini file in this directory\n"
487+
" -C Do not chdir to the script's directory (no-op in CLI)\n"
487488
" -n No configuration (ini) files will be used\n"
488489
" -d foo[=bar] Define INI entry foo with value 'bar'\n"
489490
" -e Generate extended information for debugger/profiler\n"
@@ -492,6 +493,7 @@ static void php_cli_usage(char *argv0)
492493
" -i PHP information\n"
493494
" -l Syntax check only (lint)\n"
494495
" -m Show compiled in modules\n"
496+
" -q Do not output HTTP headers (no-op in CLI)\n"
495497
" -r <code> Run PHP <code> without using script tags <?..?>\n"
496498
" -B <begin_code> Run PHP <begin_code> before processing input lines\n"
497499
" -R <code> Run PHP <code> for every input line\n"

‎sapi/cli/tests/gh9670.phpt‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
GH-9670 (php -h does not list the -C and -q options)
3+
--SKIPIF--
4+
<?php
5+
include "skipif.inc";
6+
?>
7+
--FILE--
8+
<?php
9+
10+
$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
11+
12+
foreach (explode("\n", `$php -n -h`) as $line) {
13+
if (preg_match('/^ -[Cq] /', $line)) {
14+
echo $line, "\n";
15+
}
16+
}
17+
18+
?>
19+
--EXPECT--
20+
-C Do not chdir to the script's directory (no-op in CLI)
21+
-q Do not output HTTP headers (no-op in CLI)

0 commit comments

Comments
 (0)