To me it does not make sense to have a scalar type hint. For the
simple reason it's inconsistent with PHP, and it adds no value other
then the fact you then know the value is not on array (or maybe not a
resource?). It's also inconsistent with PHP, array type hinting, is
complemented by array type-casting like print_r((array) "foobar"), you
can not echo (scalar) Array('FooBar'); for obvious reasons. I
understand type hinting is not type casting (duh) but I think they
should correlate more then they do, it just makes sense.

I have no idea the technicals behind not being able to add stricter
type hints, like; float int string, etc. But that would make a lot
more sense then the proposed scalar type hint. Do it right, or don't
add a hack is my opinion.

-Chris

On Feb 6, 2008 6:20 AM, Derick Rethans <[EMAIL PROTECTED]> wrote:
> On Wed, 6 Feb 2008, Sam Barrow wrote:
>
> > On Wed, 2008-02-06 at 09:31 +0100, Derick Rethans wrote:
> > >
> > > I still we should add simple static typehints (ie. just the types that
> > > we use in the manual) - and they should behave in the same way as the
> > > other type hints that we laready have.
> >
> > True, but we have to consider the fact that we don't have enough support
> > on that side.
>
> This is not some election campaign were you change what you believe in
> just to go get followers. So no, I will not take that into
> consideration.
>
> Derick
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Reply via email to