Re: PHP class files without <?php at the top

From: Date: Sat, 07 Apr 2012 13:43:28 +0000
Subject: Re: PHP class files without <?php at the top
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 7 Apr 2012, at 14:39, Tom Boutell wrote:

> From the viewpoint of someone writing reusable classes, the need to
> start with <?php and reprimand anybody who accidentally puts a newline
> above it is a silly annoyance they don't experience with other tools.
> 
> That said, you are making valid points, I'm not convinced myself that
> "file extensions" necessarily should or could be determined in every
> context. But it seems the most viable way of addressing the issue - if
> a viable way even exists. Partly I want to convince myself that this
> either can or can't ever be improved, and move on either way (:

If accidental newlines above the <?php are your only issue surely it makes more sense to have PHP
ignore any whitespace before an initial <?php in the file, just like it ignores a carriage return
after ?>.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


Thread (70 messages)

« previous php.internals (#59400) next »