Changes between Version 1 and Version 2 of Ticket #22400, comment 2
- Timestamp:
- 11/09/2012 11:23:53 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22400, comment 2
v1 v2 1 1 Having `$defaults` contain all valid parameters certainly helps a lot but I still think `extract()` is bad. 2 2 3 If I see `$foo` somewhere deep in the function, it's not immediately clear if this is a function-set value or a user-supplied value. Yes, I probably have to search either way to see where the variable comes from but by instead using `$args['foo']`, it's moreclear that this is a configuration argument rather than just a data storage variable.3 If I see `$foo` somewhere deep in the function, it's not immediately clear if this is a function-set value or a user-supplied value. Yes, I probably have to search either way to see where the variable comes from but by instead using `$args['foo']`, it's immediately clear that this is a configuration argument rather than just a data storage variable. 4 4 5 5 I think another question is what's the advantage to using `extract()`? I can't think of any other than saving keystrokes which shouldn't be a valid reason.