2009/7/10 Ionut G. Stan <ionut.g.s...@gmail.com> > On 7/10/2009 13:23, Giovanni Giacobbi wrote: > >> On Fri, Jul 10, 2009 at 02:44:52AM +0200, troels knak-nielsen wrote: >> [...] >> >> >>> For example, instead of: >>> >>> function addFive(int $x) { >>> return $x + 5; >>> } >>> >>> You would simply do: >>> >>> function addFive(is_numeric $x) { >>> return $x + 5; >>> } >>> >>> Since $x is guaranteed to be numeric, it is safe to to arithmetic on >>> it. No reason to explicitly type cast here. >>> >>> >>> >> I like it too. Not only it solves the initial problem, but it also allows > userland extensions. For example, > the current patch does not provide checks for callables, but we already > have is_callable in the core.
But isn't is_numeric still a valid class name? Would that mean that classes could no longer be called is_*?