On 27/02/2021 19:29, tyson andre wrote:
- Checking the difference between two runs is useful in a bug report - if counts increase or decrease after calling a function that isn't supposed to modify reference counts, this makes it an obvious indicator for reference counting bugs that can be submitted or requested on issue trackers such as bugs.php.net
That does sound a reasonable use case. My instinct was that those kind of users would be likely to use PHPDBG, or some C-level debugging method, but if this is common, it would be a reason to keep it in some form.
- Dynamic values (e.g. db results) generally aren't constant values, with some exceptions.
That sounds like a bit of a tautology to me: of course dynamic values aren't constant. My reasoning was less about that specific case, and more about internal optimisations in general causing the output to change in hard-to-understand ways. Are we confident that after fixing that, another change won't make the output hard to interpret once again?
This also seems like it's being proposed out of a desire to have fewer print functions
Actually, it was motivated by this documentation bug and many like it: https://bugs.php.net/bug.php?id=80804
The manual page still gives the incorrect advice to force a pass-by-reference when calling it, which hasn't been possible in any supported version of PHP for over 5 years.
I'm working on a rewrite of that manual page, but it's honestly quite hard to explain what the refcount *does* tell you. If it stays, it should probably be labelled more clearly as something most users will never need or understand.
Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php