Skip to content

Fix PHP 8.4/8.5 deprecations - #2

Merged
AydinHassan merged 4 commits into
0.8from
php-8.5
Oct 22, 2026
Merged

AydinHassan merged 4 commits into
0.8from
php-8.5

Conversation

@AydinHassan

Copy link
Copy Markdown
Member

Makes keylighter run cleanly on PHP 8.4 and 8.5. Intended release: 0.8.5 (patch, no BC break).

  • Explicit ?Type for implicitly nullable parameters (PHP 8.4 deprecation), incl. highlight() in functions.php
  • Fix null str_replace argument in TokenFactory::getName and declare LanguageToken::$inject (dynamic property deprecation)
  • Allow PHPUnit ^9.6 in dev so the suite runs on 8.5 (PHPUnit 8 crashes there)

PHP minimum unchanged (^7.1.3 | ^8.0).

Tested on PHP 8.5.12 with error_reporting=-1: 128 tests, 205 assertions, 2 skipped (pre-existing), 0 deprecations.

Known, not fixed: the Ruby language regex (Language/Ruby.php:87) fails to compile on current PCRE2 — a runtime error, not a deprecation; PHP highlighting is unaffected.

Unblocks php-school/cli-md-renderer 4.0 (commonmark 2) and php-workshop on PHP 8.5.

🤖 Generated with Claude Code

AydinHassan and others added 4 commits October 22, 2026 14:10
…ions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anguageToken::$inject property

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rnings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AydinHassan
AydinHassan merged commit 155bc2b into 0.8 Oct 22, 2026
2 checks passed
@AydinHassan
AydinHassan deleted the php-8.5 branch October 22, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant