Changes between Initial Version and Version 1 of Ticket #14671, comment 27
- Timestamp:
- 01/21/2013 10:27:41 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #14671, comment 27
initial v1 5 5 6 6 1. For internal PHP functions, if you pass more arguments than the function is defined to take, it will issue a warning, for example: `PHP Warning: strtoupper() expects exactly 1 parameter, 3 given`. 7 2. For user-defined functions that have optional arguments, sometimes they are designed to behave differently when additional arguments are supplied. If the developer is not aware of a filter being supplied extra arguments, they may assume that any argument defaults they define in their function will be used, only to be surprised when any extra arguments for the filter get supplied the function's optional arguments. This is the point that jacobsantos makes above: http://core.trac.wordpress.org/ticket/14671?replyto=26#comment:77 2. For user-defined functions that have optional arguments, sometimes they are designed to behave differently when additional arguments are supplied. If the developer is not aware of a filter being supplied extra arguments, they may assume that any argument defaults they define in their function will be used, only to be surprised when any extra arguments for the filter get supplied the function's optional arguments. This is the point that jacobsantos makes above: comment:7 8 8 9 9 The 2nd point above would actually be a potential issue with my patch because it uses Reflection's `getNumberOfParameters` method instead of `getNumberOfRequiredParameters`. Perhaps the latter would be a more suitable default. In any case, if the default is not correct, the developer may supply the 4th argument.