On 3 June 2010 18:25, Josh Davis <php...@gmail.com> wrote:
> seems that mysqlnd experiments in using MySQL's binary protocol for
> all queries and not just prepared statements [1] didn't materialize.

I have to correct myself here, the MYSQLI_OPT_INT_AND_FLOAT_NATIVE
option did materialize, so native typing through mysqlnd only seems to
require one call to $mysql->options()

On 3 June 2010 18:32, Lukas Kahwe Smith <m...@pooteeweet.org> wrote:
> Thats all fine and dandy if the ultimate goal is to turn PHP into a
> strictly typed language and of course if 90% of the API's you talk to
> require strict typing, then the question becomes why even use a dynamic
> language to begin with?

One of PHP's strength is that if you don't want to bother with
variable types you don't have to, but if you want to then you should
be able to without an incessant use of userspace validation. I'm glad
that PHP lets me concatenate an integer and a string (or even echo an
integer for that matter) but at the same time if I'm using an "int"
typehint then I strongly hope that all that will get through will be
an "int" variable. I see typehints as a sanity check, to be used in
situations where I know that the only way for the wrong type to get
passed is because of a bug.

So why PHP? Because it allows to write tons of stuff very easily. And
wherever you want more control you can have it too.

As Ferenc Kovacs pointed out, saying that wanting strict typehints
means wanting to turn PHP into a strictly typed language is as absurd
as claiming that proponents of a more relaxed typehinting would lead
to eliminating the integer type altogether because "1" + "2" behaves
as expected anyway.

I'm sure that nobody wants to go that far on either end of the
spectrum. This isn't about ideology, this is about practicality. A
strictly typed PHP is impractical. And for me, an integer typehint
that doesn't differentiate between strings and integers is
impractical.

-JD

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

Reply via email to