Re: Introducing pragmas into PHP?
| From: | Terry Ellison | Date: | Sun, 08 Dec 2013 18:44:16 +0000 |
| Subject: | Re: Introducing pragmas into PHP? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70539@lists.php.net to get a copy of this message | ||
On 08/12/13 18:12, Felipe Pena wrote:
Yes, extending declare would be a more elegant approach, but there is a problem with an extended the declare syntax -- statements such as: declare( allow_override_builtins = 1); would generate additional compiler warnings when used on all previous versions, and one of my aims was to enable B/C back to PHP 5.3 at least. Also as declare is a pure compiler construct that only applies to the source, there would be no equivalent mechanism for, say, defining a namespace-wide set of pragmas without further modifying every source file.On 08/12/13 17:14, Alexey Zakhlestin wrote:Looks like you misread Alexey's post. He was talking about declare construct, not define() function. Apologies to you Alexey, as the point that you made was very relevant, and my reply was a response to a misreading as Felipe as kindly pointed out.Alexey, perhaps ... and mindfart following.I am suggestion the overload of constants of the form PHP_PRAGMA_XXX to define PHP / Zend compiler / executor behaviours...we already have declare() for this purpose exactly. http://docs.php.net/declare