Skip to content

Regression: implicit nullable (string $s = null) E_DEPRECATED silent on file compile under PROFILE=8.4 (re-#23720, Zend/zend_compile.c) #26083

Closed

Description

@PurHur

Category

Regression · php-src-strict · PHP 8.4 implicit nullable deprecation

Problem

PHP 8.4 emits E_DEPRECATED for implicitly nullable parameters (function f(string $s = null) must be ?string). Under PHP_COMPILER_PROFILE=8.4, eval emits the deprecation but file parseAndCompile stays silent.

Closed #23720 / #22987 / #21390; still red on master 2026-07-31.

Path Zend 8.4 VM PROFILE=8.4 (2026-07-31, d695ddb2c)
eval('function f(string $s = null){}') E_DEPRECATED 8192 E_DEPRECATED 8192 (OK)
file function f_file(string $s = null){} E_DEPRECATED 8192 silent

php-src reference

PHP implementation target

  • lib/Compiler.php / compile-time param typing — emit the same E_DEPRECATED on file compile as on eval when profile ≥ 8.4
  • No new C in runtime/

Repro

./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4
cat > /tmp/impl_null_file.php <<\"PHP\"
<?php
error_reporting(E_ALL);
set_error_handler(function ($no, $msg) {
  echo \"ERR:$no:$msg\n\";
  return true;
});
function f_file(string $s = null) { return $s; }
echo \"file_done\n\";
PHP
php bin/vm.php /tmp/impl_null_file.php
# want: ERR:8192:Implicitly marking parameter $s as nullable is deprecated...
# today: file_done only'

Done when

  • File compile emits Zend-equivalent E_DEPRECATED under PROFILE=8.4
  • eval path remains green
  • Compliance .phpt under test/compliance/cases/language/
  • php-src-strict; no php-compiler-strict shortcut

Related

Activity

  1. added
    bugSomething isn't working
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 31, 2026
  2. PurHur commented on Jul 31, 2026

    @PurHur
    OwnerAuthor

    claim: Lane B implementer — starting this run

    Trust gates (pre-claim):

    • docker info: ok
    • release-readiness / inventory: in flight
    • Issue: file parseAndCompile silent on implicit nullable under PROFILE=8.4; eval path already emits E_DEPRECATED

    Branch: agent/issue-26083-implicit-nullable-file-deprecation

  3. PurHur commented on Jul 31, 2026

    @PurHur
    OwnerAuthor

    Merged via #26101

    Fix: PROFILE≥8.4 guest error_reporting default is now Zend 8.4's 30719 (E_ALL without E_STRICT), so file-level implicit-nullable compile deprecations are no longer filtered by the ≤8.3 22527 mask.

    Verified:

    $ PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/impl_null_file.php
    PHP Deprecated:  Implicitly marking parameter $s as nullable is deprecated...
    file_done
    $ error_reporting() → 30719 (PROFILE=8.4); 22527 (default)
    $ phpunit --filter 'implicit_nullable_parameter|error_reporting_default_mask' → OK
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions