View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000928 | XMB1 | New Features | public | 2026-08-20 14:48 | 2026-08-20 15:08 |
| Reporter | miqrogroove | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | new | Resolution | open | ||
| Target Version | 1.12.00 | ||||
| Summary | 0000928: Implement the NoDiscard Attribute | ||||
| Description | PHP 8.5 introduced a "NoDiscard" attribute that can emit warnings if a function or method's return value is never used. Some limited instances of this might be good in the long run. | ||||
| Additional Information | The attribute is intended to be used on functions where the user of the function is likely to forget using the return value by accident and where not using the return value will result in buggy behavior that is hard to detect during testing. The above example of the bulk_process() function is a good use-case. It is a function with side-effects and it will correctly process all the items in the vast majority of the cases, making it easy to miss the failure case when testing the functionality. str_contains() on the other hand is likely to be a bad use-case. It is unlikely for a developer to call str_contains() and not do anything with the result, as the function does not result in side-effects (other than implicitly casting the arguments to strings). If the developer forgets to use the return value anyways, it will just result in unnecessary processing without any further negative effects. The same reasoning applies to most “pure” functions. | ||||
| Tags | No tags attached. | ||||
| MySQL Version | |||||
| PHP Version | |||||
| Web Server | |||||
| Browser | |||||
| Flags | |||||
| Original Reporter | |||||
| SVN Revision | |||||
| Git Commit | |||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-08-20 14:48 | miqrogroove | New Issue | |
| 2026-08-20 15:08 | miqrogroove | Additional Information Updated |