On 15/01/2015 16:01, Pavel Kouřil wrote:
On Thu, Jan 15, 2015 at 4:35 PM, Jordi Boggiano <j.boggi...@seld.be> wrote:

I mean that if someone wants strict typing they won't want to use weak hints
because that would coerce the data before they can verify it and ensure
their code is strictly typed.

Therefore the best course of action is to have no hint + check manually,
like they are doing now with such libs.


I'm sorry, but I still don't follow.

For the writer of a library, he is always guaranteed to get the types
he wants (declared in typehints) and therefore checking inside the
method doesn't really make any sense. Or are you saying that
developers would use checks inside of methods instead of typehints,
even if the RFC passed in its current state with the declare()
statement?

No I am saying if it passes *without* declare then people wishing to use strict types would have to build their own typing, effectively removing the choice from these library's users as to whether they want strict hints or not.

It's just an argument in favor of having declare().

Cheers

--
Jordi Boggiano
@seldaek - http://nelm.io/jordi

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

Reply via email to