On Thu, Feb 5, 2015 at 9:59 AM, Stanislav Malyshev <smalys...@gmail.com> wrote:
> Hi!
>
>> However I feel like the fact that it only affects your app (even if
>> you use a library relying on strictness) if you want to is not clear
>> for everyone replying here. Is this point clear for you?
>
> I was addressing the idea that every scalar type mention should be
> strict. If it is a choice, I am more open to it, even though I think
> declare is a very ugly way of doing it. I'd rather have foo(scalar $bar)
> for traditional (coercive) scalar typing, and something like foo(scalar!
> $bar) (you can bikeshed the syntax if you like) for strict typing. It is
> immediately clear what each one does, does not conflict with PHP
> tradition, and allows to freely choose and intermix strictness levels as
> one's hear desires.
>
> --
> Stas Malyshev
> smalys...@gmail.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Hi,

the problem with foo(string $bar) and foo(string! $bar) or
foo((string) $bar) is that the writer of the method is deciding, not
the caller - but in both cases, the method gets exactly what it needs
to have, so the way how it should be passed should be upon the caller.

Also, this discussion shows why exactly is it a bad idea to have two
ways of passing parameters - it's a mess and there isn't an ideal way
how to solve it.

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

Reply via email to