Skip to content

Stdlib: ReflectionAttribute::getTarget() returns Attribute::TARGET_* (#22044) - #22060

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-22044-reflection-attribute-get-target
Jul 22, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-22044-reflection-attribute-get-target

Conversation

@PurHur

@PurHur PurHur commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement ReflectionAttribute::getTarget() (VM + JIT) returning the declaration-site Attribute::TARGET_* bitmask, matching php-src zim_reflection_attribute_getTarget.
  • Persist target on attribute stubs from AttributeRegistry / parameter getAttributes; JIT getAttributes paths set $target when allocating ReflectionAttribute.
  • PHP-in-PHP only — no new C runtime.

php-src reference: ext/reflection/php_reflection.c — zim_reflection_attribute_getTarget; Zend/zend_attributes.h — ZEND_ATTRIBUTE_TARGET_*

Closes #22044

Test plan

  • Zend vs VM vs JIT: test/repro/maintainer_gap_reflection_attribute_get_target.php
  • Compliance: test/compliance/cases/stdlib/reflection/reflection_attribute_get_target.phpt (VM + JIT via phpunit filter)
  • php script/bootstrap-inventory.php --check → OK 6335/6335
  • Spine coverage/count + sidecar stamp sync after require_once additions

Verification transcript

$ php test/repro/maintainer_gap_reflection_attribute_get_target.php
class=1
method=4
prop=8
const=16
param=32
func=2
…
$ php bin/vm.php test/repro/maintainer_gap_reflection_attribute_get_target.php
(same)
$ php bin/jit.php test/repro/maintainer_gap_reflection_attribute_get_target.php
(same)
$ ./script/phpunit.sh --filter reflection_attribute_get_target
OK (2 tests, 2 assertions)
$ php script/bootstrap-inventory.php --check
OK 6335/6335
$ php script/check-selfhost-spine-sidecar-sync.php
OK (stamp matches spine entry SHA-1 a3fc548286c85d7698d653d3239127e46bdef574)

Made with Cursor

…22044)

Store the declaration-site TARGET_* bitmask on ReflectionAttribute and
expose getTarget() on VM/JIT to match php-src zim_reflection_attribute_getTarget.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur force-pushed the agent/issue-22044-reflection-attribute-get-target branch from 8e2c8ef to 8d3fc3a Compare July 22, 2026 06:02
@PurHur
PurHur merged commit 30c1b0b into master Jul 22, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-22044-reflection-attribute-get-target branch July 22, 2026 06:02
PurHur added a commit that referenced this pull request Jul 22, 2026
…) (#22075)

Emergency stamp: master lib/ext moved after the last fingerprint stamp,
re-breaking north-star5-fast 4f-m (manifest 8b4e4f06… vs live d22247bd…).
Honest blob rebuild still deferred; spine sidecar SHA already matches.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
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.

Stdlib: ReflectionAttribute::getTarget() missing — Zend returns Attribute::TARGET_* bitmask (ext/reflection/php_reflection.c)

1 participant