<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--txdq1xybr" -->

---
title: [RFC] [Discussion] Add ReflectionAttribute::getCurrent()
description: A PHP internals mailing list discussion about a proposed RFC to add ReflectionAttribute::getCurrent(), a static method that, when called from an attribute...
canonical: https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--txdq1xybr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: [RFC] [Discussion] Add ReflectionAttribute::getCurrent() | daily.dev
og:description: A PHP internals mailing list discussion about a proposed RFC to add ReflectionAttribute::getCurrent(), a static method that, when called from an attribute...
og:url: https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--txdq1xybr
og:image: https://api.daily.dev/og/posts/tXdq1xybr.png
og:image:alt: [RFC] [Discussion] Add ReflectionAttribute::getCurrent()
og:image:width: 1200
og:image:height: 630
og:locale: 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)** · 48 min read · 0 upvotes · 0 comments

## Summary

A PHP internals mailing list discussion about a proposed RFC to add ReflectionAttribute::getCurrent(), a static method that, when called from an attribute constructor, returns the ReflectionAttribute instance corresponding to the attribute's usage. The RFC author Daniel Scherzer explains the need: attribute constructors currently have no clean way to access the reflection target they are applied to. The thread debates design trade-offs — using a static 'magic' method vs. engine-level constructor injection vs. a dynamic method. Key concerns include backwards compatibility (injecting parameters would silently break existing attributes), the oddity of a context-sensitive static method, and the difficulty of opt-in mechanisms. The RFC was updated to split the feature into two methods: getCurrent() returning the ReflectionAttribute, and a normal dynamic getReflectionTarget() method on that object.

## Full article

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

## Similar posts on daily.dev

- [\[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--oqrxohfqw) · externals.io · 0 upvotes · 0 comments
- [\[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--atpduvunh) · 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--txdq1xybr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"[RFC] [Discussion] Add ReflectionAttribute::getCurrent()","url":"https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--txdq1xybr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--txdq1xybr"},"datePublished":"2026-06-07T12:41:45.510Z","dateModified":"2026-06-07T12:45:27.950Z","description":"A PHP internals mailing list discussion about a proposed RFC to add ReflectionAttribute::getCurrent(), a static method that, when called from an attribute...","image":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","thumbnailUrl":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","isAccessibleForFree":true,"articleSection":"externals.io","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"externals.io","logo":"https://media.daily.dev/image/upload/s--9i0zxASK--/f_auto,q_auto/v1780213616/logos/externals?_a=BAMAMiWQ0","url":"https://daily.dev/sources/externals"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rfc-discussion-add-reflectionattribute-getcurrent--txdq1xybr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php","timeRequired":"PT48M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"externals.io","item":"https://daily.dev/sources/externals"},{"@type":"ListItem","position":3,"name":"[RFC] [Discussion] Add ReflectionAttribute::getCurrent()"}]}
```

