> -----Message d'origine-----
> De : Pierre Joye [mailto:pierre....@gmail.com]
>
> > Is there a technical problem with code located outside of definitions, or 
> > is it
> just a convention (PSR already contains this rule) ? I understand the
> problems it poses in HHVM, but I don't see why we should check that with
> the engine as it is structured now. Even if we can detect such questionable
> usage (and we can detect it quite easily just using tokenizer output), IMO,
> we are not responsible of what developers put in their scripts.
> 
> I was too vague.
> 
> If some code is loaded and part of it will be always executed even if
> not used at all in a request, this will have side effects. Also
> besides the impact of having code being ran on each request, I do not
> think it is good idea to being to have top context running code, at
> all :)

OK, I understand that it is a very bad idea but I am not sure we should spend 
time working on tools to avoid this.

The first reason is that there may be cases where this would be legitimate. I 
don't imagine any today but we are not aware of every ways PHP can be used.

The second reason is that it is not a feature for newbies. People writing code 
to be executed at each request start are supposed to know what they're doing. 
If they are fool enough to introduce such crap, it is their problem, not ours.

Cheers

François


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

Reply via email to