Skip to content

Language: dynamic property deprecation — JIT/AOT E_DEPRECATED on undeclared write (phase 2 of #3253) #5111

Description

@PurHur

Category

language

Problem

PHP 8.2+ deprecates creating dynamic properties on classes that do not allow them. #3253 closed VM notices via emitDeprecatedNotice. JIT/AOT property writes on ordinary classes still skip the deprecation path — test/compliance/DynamicPropertyDeprecatedJITTest.php is skipped until MCJIT matches Zend.

Self-host and apps compiled with bin/jit.php / AOT must see the same E_USER_DEPRECATED (respecting error_reporting) as Zend for undeclared writes.

php-src reference

Repro (today)

Use test/compliance/cases/language/dynamic_property_deprecation.phpt:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/compliance/cases/language/dynamic_property_deprecation.phpt
# JIT (currently skipped in DynamicPropertyDeprecatedJITTest):
php bin/jit.php test/compliance/cases/language/dynamic_property_deprecation.phpt
'
Runtime Class C undeclared $y
Zend / VM PHP Deprecated: Creation of dynamic property C::$y then 2
JIT deprecation missing or test skipped

Scope (this repo)

Module Path
JIT property set lib/JIT.php, lib/JIT/Builtin/Type/Object_.php
Deprecation helper reuse VM message formatting / Compiler\DeprecatedMetadata
Tests test/compliance/DynamicPropertyDeprecatedJITTest.php — unskip when green

Done when

Activity

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 machineenhancementNew feature or requestimplementation-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