Re: Make Reflection*::getDocComment() return an empty string instead of false
| From: | David CARLIER | Date: | Wed, 25 Jun 2025 12:43:28 +0000 |
| Subject: | Re: Make Reflection*::getDocComment() return an empty string instead of false | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127750@lists.php.net to get a copy of this message | ||
Hi,
It makes more sense to me too to change this behavior. I would rather go
with null though ; but that is just personal preference ; empty string is
already better than false ... Did you assess how widely it is used before
the users come back "angry" ?
Cheers.
On Wed, 25 Jun 2025 at 11:39, Gina P. Banyard <internals@gpb.moe> wrote:
> Hello internals,
>
> While working on the deprecation to/from bool type juggling in functions
> RFC and seeing the impact within Symfony, we found a common slightly
> annoying case.
> The getDocComment method of various Reflection classes was always used as
> a string, and we thought changing the behaviour in PHP made more sense.
>
> I submitted a PR [1] but was asked to gather feedback on the mailing list.
>
> Please let me know what you think.
>
> Best regards,
>
> Gina P. Banyard
>
> [1] https://github.com/php/php-src/pull/18928
>