On 21/10/2014 02:48, Stas Malyshev wrote:
It would be possible to make to_int() merely an alias of
>filter_var(…, FILTER_VALIDATE_INT). Though that would make it depend
>on ext/filter or otherwise duplicate functionality.
You seem to sound like depending on something already existing in PHP is
a bad thing.


I think the point was that ext/filter extension is optional (its enabled by default, but not mandatory) whereas

I'm not sure how using function starting with to_ is "more
straightforward" than using function starting with filter_

As I mentioned in a previous thread, the design of ext/filter makes it feel like a Swiss Army knife when what I'm looking for is a pair of scissors - it will work, but I have to figure out how to select the right component (both a function and a filter type), and whether the other bits will get in my way (do I need to set any options? what is the actual return type?).

On the other hand, the myriad of options it provides covers off most of the issues in this discussion, so maybe that complexity is the price you pay for pleasing all the people, and it's just a matter of documentation.

--
Rowan Collins
[IMSoP]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to