Skip to content

ext/readline: Fix class constant completion in readline interactive shell - #23218

Merged
LamentXU123 merged 2 commits into
php:PHP-8.4from
LamentXU123:bugfix-readline
Aug 12, 2026
Merged

ext/readline: Fix class constant completion in readline interactive shell#23218
LamentXU123 merged 2 commits into
php:PHP-8.4from
LamentXU123:bugfix-readline

Conversation

@LamentXU123

@LamentXU123 LamentXU123 commented Aug 11, 2026

Copy link
Copy Markdown
Member

See #22994 (comment)_

This bug is really interesting! php -a class constant completion passed the full ClassName::PREFIX string to the constant completion generator. And textlen had already been shortened to the part after ::.

This made constants match against the leading characters of the class names. For example, Foo::Ze<TAB> could complete to Foo::FooBar instead of Foo::Zed.

Comment thread ext/readline/tests/readline_cli_completion_class_constant.phpt
Co-authored-by: Ilia Alshanetsky <ilia@ilia.ws>
@LamentXU123
LamentXU123 requested a review from iliaal August 12, 2026 11:39

@iliaal iliaal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LamentXU123
LamentXU123 merged commit f6dba91 into php:PHP-8.4 Aug 12, 2026
18 checks passed
@LamentXU123

Copy link
Copy Markdown
Member Author

Thanks!

LamentXU123 added a commit that referenced this pull request Aug 12, 2026
* PHP-8.4:
  ext/readline: Fix class constant completion in readline interactive shell (#23218)
LamentXU123 added a commit that referenced this pull request Aug 12, 2026
* PHP-8.5:
  ext/readline: Fix class constant completion in readline interactive shell (#23218)
LamentXU123 added a commit that referenced this pull request Aug 12, 2026
LamentXU123 added a commit that referenced this pull request Aug 12, 2026
* PHP-8.4:
  [skip ci] Fix NEWS entries in #23218
LamentXU123 added a commit that referenced this pull request Aug 12, 2026
* PHP-8.5:
  [skip ci] Fix NEWS entries in #23218
NickSdot pushed a commit to NickSdot/php__php-src that referenced this pull request Aug 12, 2026
* PHP-8.5:
  ext/readline: Fix class constant completion in readline interactive shell (php#23218)
pull Bot pushed a commit to KornaPhp/php-src that referenced this pull request Aug 12, 2026
* PHP-8.4:
  ext/gettext/tests: updates for musl-1.2.6
  ext/snmp: Add XFAIL on several tests (php#22476) (php#23231)
  ext/readline: Fix class constant completion in readline interactive shell (php#23218)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants