Skip to content

Fix implicit nullable param deprecation for PROFILE=8.4 - #21397

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-21390-implicit-nullable-deprecation
Jul 20, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-21390-implicit-nullable-deprecation

Conversation

@PurHur

@PurHur PurHur commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Closes #21390

Summary

  • add CompilerVersion::supportsImplicitNullableParameterDeprecation() (8.4+ language-profile gate)
  • emit E_DEPRECATED during parameter compilation for implicit-nullable typed params (int $x = null) using VM error pipeline so set_error_handler() observes it
  • add compliance guards for 8.4 emit and 8.3 silence across function, method, closure, and arrow params

Verification

  • PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/issue21390_repro.php
    • output: [8192] Implicitly marking parameter $x as nullable is deprecated, the explicit nullable type must be used instead
  • ./script/docker-exec.sh -- bash -lc 'php vendor/bin/phpunit test/compliance --filter implicit_nullable_parameter'
    • output: OK (4 tests, 4 assertions)
  • pytest tests/ -q
    • output: 1 passed in 0.01s

Made with Cursor

Emit the Zend-matching compile-time E_DEPRECATED for typed `= null` params behind a new profile gate and add compliance guards for 8.4 emit / 8.3 silence across functions, methods, closures, and arrows.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Language: implicit nullable parameter (int $x = null) missing E_DEPRECATED on PROFILE=8.4 (Zend/zend_compile.c)

1 participant