# [RFC] Add dedicated StreamBucket object

- Thread: https://externals.io/message/122190
- Original archive: https://news-web.php.net/php.internals/122190
- Started by kocsismate90@gmail.com on 2024-01-19T14:39:27+00:00
- Messages: 5
- RFC: Dedicated StreamBucket class (Implemented (PHP 8.4)) — https://externals.io/rfc/dedicated_stream_bucket.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #122190 — kocsismate90@gmail.com — 2024-01-19T14:39:27+00:00

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

Hi Internals,

As I have already shared my intentions in
https://externals.io/message/122149, I'd like to add a dedicated object for
stream buckets as opposed to the stdClass instances which are used nowadays.

Please read https://wiki.php.net/rfc/dedicated_stream_bucket

Regards,
Máté

---

## #122191 — Kamil Tekiela — 2024-01-19T14:58:32+00:00

URL: https://externals.io/message/122190#122191 · In reply to: #122190

What should users replace $bucket property with in PHP 8.4? Is there
an alternative or is this a deprecation without a way to solve it? If
there is currently no alternative I would not deprecate it. Just
remove it once it becomes useless.

---

## #122202 — kocsismate90@gmail.com — 2024-01-20T12:42:11+00:00

URL: https://externals.io/message/122190#122202 · In reply to: #122191

> What should users replace $bucket property with in PHP 8.4? Is there
> an alternative or is this a deprecation without a way to solve it? If
> there is currently no alternative I would not deprecate it. Just
> remove it once it becomes useless.
>

Do users actually use the $bucket property? I would be surprised if they
did. They don't
have to use it as far as I can see.

Cheers,
Máté

---

## #122203 — Nicolas Grekas — 2024-01-20T13:25:50+00:00

URL: https://externals.io/message/122190#122203 · In reply to: #122202

Le sam. 20 janv. 2024 à 13:42, Máté Kocsis <kocsismate90@gmail.com> a
écrit :

> > […]
>
> Do users actually use the $bucket property? I would be surprised if they
> did. They don't
> have to use it as far as I can see.
>

I've used it a few year ago in a stream filtering experiment:
https://github.com/nicolas-grekas/Patchwork-PHP-Parser/blob/master/class/Patchwork/PPP/AbstractStreamProcessor.php

I don't remember the purpose of the property though. This would need more
investigation.

Nicolas

---

## #122702 — kocsismate90@gmail.com — 2024-03-20T21:11:26+00:00

URL: https://externals.io/message/122190#122702 · In reply to: #122203

Hey Nicolas,

Sorry for the multi-months pause, I was working on other stuff recently.

Thank you again for the insights! I'm not sure anyone besides you has ever
used this property, but now we know
about at least one use-case. :) That's why I slightly changed the proposal:
the property would only be deprecated
as soon as the resource to object migration happens, and it would be kept
at least for an additional major release
cycle.

I hope that the proposal is fine this way. If there will be no complaints,
I would like to start the vote
sometime next week.

Regards,
Máté
