On Tue, Jun 16, 2026 at 7:02 PM Sarina Corrigan <[email protected]>
wrote:

>
>
> On Tue, Jun 16, 2026, 18:22 Michael Morris <[email protected]> wrote:
>
>> Here's a thought - Instead of .phpc as an extension, why not <?phpc or
>> even <?psf (PHP source file). Explicitly tell the engine "nothing should be
>> before this other than a shebang, no further tags will be in this file.
>>
>> That also solves the inadverted echo problem and would be fully BC.
>>
>> Not convinced it would be useful, but it has fewer problems.
>>
>
> I could actually get behind an alternative tag that reads everything as
> PHP. It would at least solve the problem of accidental output prior to the
> opening tag, though I'm not sure how big of a problem that really is. Could
> we expect any performance benefits from not having to parse for any closing
> tags? I imagine it would be minuscule if anything
>

Thinking on this a bit more, if it is an independent tag it could hold
directives on how the file should be parsed.

<?psf strict ?> Parse the file with strict mode. Here the closing tag means
we're done passing directives, no further tags will be allowed in the file
and the parser will remain in PHP mode for this file.

<?psf new_scope ?> Create a new scope - that is no variables, symbols or
autoloaders will be shared with the file that included this one. This is an
alternate way to do containers aside from creating a new function.

Thoughts?

Reply via email to