Changes between Initial Version and Version 1 of Ticket #49628, comment 16
- Timestamp:
- 11/07/2021 01:25:51 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #49628, comment 16
initial v1 6 6 7 7 1. The documentation clearly states it should be a boolean. 8 2. The return value can be cast to a boolean `(bool) $is_viewable`, which should suffice.8 2. The return value can be cast to a boolean, which should suffice: `return (bool) $is_viewable;` 9 9 10 Thisadds 3 extra opcodes, of which 1 jump -- roughly 17 times per request on a clean install.10 Currently, this defense adds 3 extra opcodes, of which 1 jump -- roughly 17 times per request on a clean install. 11 11 12 12 If we want to focus on performance, we need to be reticent with introducing defensive code and expect developers to abide by the types. I think this is especially true (pun intended) for newly introduced and substantially better-documented functions/methods/filters/actions.