# Adding attributes to compile-time constants

- Thread: https://externals.io/message/126065
- Original archive: https://news-web.php.net/php.internals/126065
- Started by Daniel Scherzer on 2024-11-26T20:15:12+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #126065 — Daniel Scherzer — 2024-11-26T20:15:12+00:00

URL: https://externals.io/message/126065#126065

Hi internals,

For the last few weeks, I've been working on a patch[1] that I just
uploaded that adds support for attributes on compile-time non-class
constants (those declared with `const` rather than via `define()`). The
patch has a memory leak that I have been unable to resolve, but otherwise
the functionality is there and seems to work. Is anyone willing to help
with the memory issue?

Separately, once the memory issue is fixed, would this need to go through
an RFC process?

Thanks,
--Daniel Scherzer

[1] https://github.com/php/php-src/pull/16952

---

## #126067 — Larry Garfield — 2024-11-26T20:39:20+00:00

URL: https://externals.io/message/126065#126067 · In reply to: #126065

> Hi internals,
>
> For the last few weeks, I've been working on a patch[1] that I just 
> uploaded that adds support for attributes on compile-time non-class 
> constants (those declared with `const` rather than via `define()`). The 
> patch has a memory leak that I have been unable to resolve, but 
> otherwise the functionality is there and seems to work. Is anyone 
> willing to help with the memory issue?
>
> Separately, once the memory issue is fixed, would this need to go 
> through an RFC process?
>
> Thanks,
> --Daniel Scherzer
>
> [1] https://github.com/php/php-src/pull/16952

I believe it would require an RFC, though I expect it would pass easily.  I'm no help on the memory question though, I'm afraid.

--Larry Garfield

---

## #126079 — tim@bastelstu.be — 2024-11-29T11:26:13+00:00

URL: https://externals.io/message/126065#126079 · In reply to: #126067

Hi

Am 2024-11-26 21:39, schrieb Larry Garfield:
> I believe it would require an RFC, though I expect it would pass 
> easily.

I agree. Attributes on regular constants introduce new syntax, which is 
a pretty clear language change and thus requires an RFC.

Best regards
Tim Düsterhus

---

## #126082 — Daniel Scherzer — 2024-11-30T10:59:09+00:00

URL: https://externals.io/message/126065#126082 · In reply to: #126065

Since it seems that this requires an RFC, I have created an account on
wiki.php.net with the username `danielescherzer` and kindly request edit
privileges so that I can create the RFC.

-Daniel

On Tue, Nov 26, 2024 at 12:15 PM Daniel Scherzer <
daniel.e.scherzer@gmail.com> wrote:

> Hi internals,
>
> For the last few weeks, I've been working on a patch[1] that I just
> uploaded that adds support for attributes on compile-time non-class
> constants (those declared with `const` rather than via `define()`). The
> patch has a memory leak that I have been unable to resolve, but otherwise
> the functionality is there and seems to work. Is anyone willing to help
> with the memory issue?
>
> Separately, once the memory issue is fixed, would this need to go through
> an RFC process?
>
> Thanks,
> --Daniel Scherzer
>
> [1] https://github.com/php/php-src/pull/16952

---

## #126083 — Christoph M. Becker — 2024-11-30T11:30:58+00:00

URL: https://externals.io/message/126065#126083 · In reply to: #126082

> Since it seems that this requires an RFC, I have created an account on
> wiki.php.net with the username `danielescherzer` and kindly request edit
> privileges so that I can create the RFC.

RFC karma granted.  Best of luck with the RFC!

Christoph
