Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #51525, comment 37


Ignore:
Timestamp:
11/20/2024 10:45:00 PM (6 months ago)
Author:
johnbillion
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51525, comment 37

    initial v1  
    13133. The type checking inside `apply_filters_typed()` does have a performance cost, however small. The `apply_filters()` function has been subject to two decades of continuous performance improvements to squeeze out every last millisecond. I don't think a performance degradation is acceptable.
    14144. The error message in the proposed function is no more helpful than the default message reported by PHP because it still doesn't identify the culprit, which is one of the main points made in the description of this ticket. In order to make it useful would require some processing of the callback to construct a name for it, reducing performance further.
    15 5. In this whole thread not one concrete example of the problem in the real world has been given.
     155. `_doing_it_wrong()` itself calls `apply_filters()`, as does the proposed `wp_is_type()`. This has the potential to turn what would be a PHP notice or warning into a fatal out of memory error.
     166. In this whole thread not one concrete example of the problem in the real world has been given.
    1617
    1718When this ticket was opened four years ago it certainly looked like we might be heading toward a problem with the increased type strictness of PHP 8. In practice I don't believe this has materialised, and if it has then it's died down already.