Skip to content

Fix dynamic property deprecation compliance guard (#14839) - #14840

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-14839-dynamic-property-deprecation
Jul 2, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-14839-dynamic-property-deprecation

Conversation

@PurHur

@PurHur PurHur commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #14839.

Dynamic property E_DEPRECATED on undeclared writes was already implemented in lib/VM.php (fetchObjectPropertyWriteLvalue) and lib/JIT/DynamicPropertyDeprecationGuard.php. This PR fixes the compliance phpt expectation so the guard matches CLI stderr formatting (file/line suffix).

Verification

Issue repro (php-src-strict, error_reporting=E_ALL):

php bin/vm.php -d error_reporting=E_ALL -r 'class C {} $c = new C; $c->x = 1; echo "ok\n";' 2>&1

Output:

PHP Deprecated:  Creation of dynamic property C::$x is deprecated in Command line code on line 1
ok

Compliance + unit guards:

./script/docker-exec.sh -- bash -lc 'php vendor/bin/phpunit \
  test/compliance/DynamicPropertyDeprecationVMTest.php \
  test/compliance/DynamicPropertyDeprecatedJITTest.php \
  test/unit/DynamicPropertyDeprecationCliTest.php'

All OK (3 tests).

stdClass remains exempt (no deprecation on dynamic writes).

Made with Cursor

…14839).

The VM and JIT already emit E_DEPRECATED on undeclared writes; update the
phpt expectation to allow the standard file/line suffix so the guard stays green.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit afe4487 into master Jul 2, 2026
@PurHur
PurHur deleted the agent/issue-14839-dynamic-property-deprecation branch July 2, 2026 01:13
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.

Parity: dynamic property creation should emit E_DEPRECATED in PHP 8.2

1 participant