---
title: "[RFC] [Discussion] Add ReflectionAttribute::getCurrent()"
url: https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--atpduvunh
source_url: https://externals.io/message/131158
type: article
source: "externals.io"
published: 2026-06-07T04:41:56.516Z
updated: 2026-06-07T04:42:20.810Z
tags: ["php"]
reading_time: 43
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# [RFC] [Discussion] Add ReflectionAttribute::getCurrent()

**[externals.io](https://daily.dev/sources/externals)** · 43 min read · 0 upvotes · 0 comments

## Summary

A PHP internals RFC discussion proposes adding ReflectionAttribute::getCurrent(), a static method callable from within an attribute constructor that returns the ReflectionAttribute instance corresponding to the current attribute usage. The core challenge is that attribute constructors have no direct access to the ReflectionAttribute object, requiring C-level backtrace processing. The RFC author updated the proposal to split functionality: getCurrent() returns the ReflectionAttribute instance (replacing hacky backtrace workarounds), while a new dynamic getReflectionTarget() method returns the reflection target. Alternative approaches like engine-level constructor injection were discussed but rejected due to backwards compatibility concerns with existing attributes.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://externals.io/message/131158>

## Similar posts on daily.dev

- [\[RFC\] \[Discussion\] Add ReflectionAttribute::getCurrent\(\)](https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--2o3q9psus) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Add ReflectionAttribute::getCurrent\(\)](https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--oqrxohfqw) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Add ReflectionAttribute::getCurrent\(\)](https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--2r3cchmot) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Add ReflectionAttribute::getCurrent\(\)](https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--txdq1xybr) · externals.io · 0 upvotes · 0 comments
- [\[VOTE\] RFC: Add ReflectionAttribute::getCurrent\(\)](https://daily.dev/posts/vote-rfc-add-reflectionattribute-getcurrent--vlkajdgr2) · externals.io · 0 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--atpduvunh)
