Skip to content

Language: implicit nullable E_DEPRECATED omits function name prefix — Zend "f(): Implicitly marking…" (zend_compile.c) #29274

Closed

Description

@PurHur

Category

language · php-src-strict · deprecation message · pillar 4

Problem

Under PROFILE≥8.4, implicit nullable parameters (function f(int $x = null)) correctly emit E_DEPRECATED, but the message omits the function-name prefix Zend prints.

Probed 2026-08-09 @ ae8a067be1 vs php:8.4-cli 8.4.24 (PHP_COMPILER_PROFILE=8.4). VM and JIT agree (both wrong). Prior issues (#21390 / #22987 / #23720 / #26083) fixed silence; remaining gap is message shape.

Repro Zend 8.4.24 VM / JIT
function f(int $x = null) {} f(): Implicitly marking parameter $x as nullable is deprecated, the explicit nullable type must be used instead Implicitly marking parameter $x as nullable is deprecated, the explicit nullable type must be used instead (no f():)

php-src reference

PHP implementation target

  • Compile-time deprecation emitter in lib/ (parser/compile path that already fires this warning) — prefix with {function}(): like Zend
  • Cover methods (C::m(): …) the same way if Zend does
  • PHP-in-PHP; no new runtime/*.c logic

Repro

./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4; php bin/vm.php test/repro/maintainer_run_20260809g/implicit_nullable_deprecated_prefix.php'
./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4; php bin/jit.php test/repro/maintainer_run_20260809g/implicit_nullable_deprecated_prefix.php'
docker run --rm -i php:8.4-cli php < test/repro/maintainer_run_20260809g/implicit_nullable_deprecated_prefix.php

Done when

  • VM + JIT: deprecation text begins with f(): Implicitly marking parameter $x as nullable…
  • Compliance .phpt guard
  • php-src-strict; no php-compiler-strict shortcut

Activity

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

    @PurHur
    OwnerAuthor

    claim: Worker lane A — starting this run

    Gates before claim: inventory OK 7262/7262; docker ok; release-readiness still running.

  3. PurHur commented on Aug 9, 2026

    @PurHur
    OwnerAuthor

    merged: #29286 (30f13b0b0c)

    Fix: Compiler::maybeEmitImplicitNullableParamDeprecation now prefixes with Zend callable label via displayCallableNameForCompileDeprecation (f():, C::m():, {closure:file:line}():).

    Verified:

    PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_run_20260809g/implicit_nullable_deprecated_prefix.php
    → f(): Implicitly marking parameter $x as nullable is deprecated…
    
    PHP_COMPILER_PROFILE=8.4 php bin/jit.php … (same)
    vendor/bin/phpunit --filter ImplicitNullableDeprecatedPrefix → OK (4 tests, 4 assertions)
    

    php-src-strict; no C runtime changes.

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 / JITarea:vmVirtual machinebugSomething 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