Re: [RFC] Deprecations for PHP 8.5
| From: | Morgan | Date: | Thu, 03 Jul 2025 08:34:47 +0000 |
| Subject: | Re: [RFC] Deprecations for PHP 8.5 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127854@lists.php.net to get a copy of this message | ||
On 2025-07-03 07:56, Gina P. Banyard wrote:
Hello internals, Some should be non-controversial, others a bit more. If such, they might warrant their own dedicated RFC, or be dropped from the proposal altogether. Best regards, Gina P. BanyardJust skimming and saw
Deprecate using values of type null and bool as array offsets and when calling array_key_exists()The discussion that follows says what is wrong with null (and I agree with that), but not why bool should be deprecated as well (in fact it mentions that bool gets cast to int). It's just that I've more than once found it self-documenting to use a bool as an array offset because I wanted to partition an array into two according to a predicate - e.g., $partition[true] contains those elements that satisfy the predicate. Especially when the question of which of those two partitions I want is itself a runtime boolean decision.