Re: Syntactical change to Scalar Type Hints RFC

From: Date: Mon, 09 Feb 2015 11:19:48 +0000
Subject: Re: Syntactical change to Scalar Type Hints RFC
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-82269@lists.php.net to get a copy of this message
Andrea Faulds wrote on 09/02/2015 00:05:
If you're going to go that far, why not just disallow the block-level syntax of declare() for this case, if that is the complaint? Or if the problem is the non-block syntax, why not enforce that a non-block declare(strict_types) be at the top of the file?
Well, it’s not just that which is the problem: declare() is rather verbose and ugly. Also, having it behave differently from all other declare() statements would bring into question why we even bother reusing the declare() syntax.
Thinking about it, declare(encoding) already disallows scope anyway, so we wouldn't even be introducing something new: "Fatal error: Encoding declaration pragma must be the very first statement in the script".

« previous php.internals (#82269) next »