[php-src] PR #21902: fix(cli): clear getopt optarg for optional long options
| From: | onthebed | Date: | Tue, 28 Apr 2026 19:26:21 +0000 |
| Subject: | [php-src] PR #21902: fix(cli): clear getopt optarg for optional long options | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35927@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21902
Author: onthebed
php_getopt() left *optarg unchanged when a long option with an optional
argument was passed without a value, so the CLI parser could reuse the previous option's
argument for --ini.
Clear optarg at the start of php_getopt() and add a regression test that
exercises -d foo=bar --ini.
Fixes #21901