Hi François,

On 8 Feb 2015, at 20:43, François Laupretre <franc...@tekwire.net> wrote:

>> De : Andrea Faulds [mailto:a...@ajf.me]
>> Instead, I’m wondering if the following might be better:
>> 
>>    <?php strict
>> 
>> Which would be used like so:
>> 
>>    <?php strict
>> 
>>    function foobar(): int {
>>        return 1.0; // error!
>>    }
>> 
>> It’d be a per-file directive, so there’d be zero mixing of modes within one
>> file, and you’d avoid the quirks of declare().
> 
> '<?php' is not a 'per-file' directive, as it can appear several times, and is 
> not always the first item in a file.
> 
> What would this mean :
> 
> Lines of data
> ...
> <?php
> php code
> ?>
> Data
> <?php strict
> Code
> ...
> 
> Would it be strict or not ? or will you interpret the first '<?php' only ? 
> What is the syntax exactly ? Does it make 'strict' a reserved keyword ?

It doesn't make "strict" be reserved.

With regards to multiple blocks, there are a few possible approaches:

* First block affects subsequent blocks, only it can declare strictness (my 
favourite)
* Per-block
* Use of directive prevents use of end tags, and thus use of multiple blocks

I think the first makes the most sense. It's what namespaces do, after all.

Thanks.

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

Reply via email to