You are missing the point, why be strict on return types, and liberal on
parameters? Be strict consistently or be liberal consistently. Or, keep php,
php. I could care less as long as things are consistent, although I think
only supporting scalar is silly regardless of type juggling.

-Chris

On Mon, Apr 14, 2008 at 7:28 AM, Christian Schneider <[EMAIL PROTECTED]>
wrote:

> Chris Stockton schrieb:
>
>  Why on earth would you have int, string, resource, etc "return type
> > hints"
> > and then turn around and suggest for parameter hinting just add a scalar
> > type? That makes no sense and is so inconsistent.
> >
> > static int function retarded(scalar $value) {
> >    return (int) $value; // lol....
> > }
> >
>
> Let me turn your question around: Why on earth would someone restrict a
> function to int when string works just as well?
>
> function int foo_flexible(scalar $x) { return $x + 42; }
> $foo = foo_flexible($value);
>
> function int foo_retarded(int $x) { return $x + 42; }
> $foo = foo_retarded((int)$value);       # :-(
>
> That said, I'll be using
> function foo($x) { return $x + 42; }
> anyway and let PHP warnings take care of the rest ;-)
>
> - Chris
>
>

Reply via email to