Hi!

> I’m not really sure this is true. I agree that strict types aren’t
> entirely in keeping with the “PHP way”. However, there are plenty of
> people who are against them not for that reason, but simply because
> they don’t work well for them. Plus, I’m not sure strict typing

I would say for myself it is both. Having PHP code that thinks 1 can not
be used as boolean true just feels wrong philosophically, but on top of
that I imaging how much (type) conversions I'd have to use to deal with
strictly-typed code in practice - it makes me sad for practical reasons.

> weakly-typed. Indeed, strict type hints don’t stop PHP being
> weakly-typed. They just check types at function call boundaries.

"Strict types don't stop PHP being weakly typed". No, that doesn't work.
Adding misleading word "hints" doesn't help either. What happens is that
with this proposal PHP would be partly strictly typed and partly weakly
typed. Which would be subject of both confusion and criticism about
language not being consistent - in one context it's fine to use 1 as
boolean, in another it's not, the fun is in the remembering where is which.

> This is unlikely to be super-representative of the PHP community.

It's not even representative of the list, that's why we have votes :)
Claiming vote result pre-vote seems to be not very useful.

> Except that is not the case for this proposal, which explicitly and
> deliberately prevents the directive affecting inclusion. The
> behaviour is impossible to toggle at runtime, unless you’re using
> some weird extension which lets you edit the flag on the
> ZEND_DO_FCALL opcode.

ZEND_DO_FCALL is not by far the only way to call a function. There are
many other ways. Keeping them all in sync and tracking the proper
context for each of them would be a very fun exercise. That's why
state-dependent behaviors usually aren't a good idea, especially if
state happens in one place and behavior in another.
-- 
Stas Malyshev
smalys...@gmail.com

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

Reply via email to