RE: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

From: Date: Mon, 09 Feb 2015 10:58:13 +0000
Subject: RE: [PHP-DEV] Syntactical change to Scalar Type Hints RFC
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
> De : Rowan Collins [mailto:[email protected]]
>
> >> Would more "strict" features be added to this mode later?
> > No.
> >
> >> Or would other keywords be added so that you could, ahem, "declare"
> several directives at the top of your block?
> > No.
> 
> I think this is all rather optimistic - if you use a specific term like
> "strict_types", people will want to use this syntax for other keywords;
> if you use something as general as "strict", they will want to add
> additional semantics to the existing keyword.

+1. We cannot allow a keyword (yes, it IS a reserved keyword) in this location and say "Oh,
that's just an exception for strict type checking, but no one has the right to do the same,
except Andrea if she needs it again in the future.".

If we extend the syntax, we must establish rules for keywords on the same line as
'<?php'. IMO, it would apply to the code block, not to the whole file, or you need to
add constraints that go too far (disable '?>' and the like). Unfortunately, the BC
break would probably make such an RFC still more problematic than strict typing.

Another concern is that 'strict', while elegant, is ambiguous. I guess most people would
think it enables E_STRICT, which I would intuitively believe.

Cheers

François



Thread (187 messages)

« previous php.internals (#82264) next »