Re: Revert Tokenizer behavior for 5.4
| From: | Chris Stockton | Date: | Thu, 15 Sep 2011 21:18:34 +0000 |
| Subject: | Re: Revert Tokenizer behavior for 5.4 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-55458@lists.php.net to get a copy of this message | ||
Hello,
On Thu, Sep 15, 2011 at 8:13 AM, Nikita Popov <nikita.ppv@googlemail.com> wrote:
> On Thu, Sep 15, 2011 at 5:05 PM, Hannes Magnusson
> <hannes.magnusson@gmail.com> wrote:
>> Wait wait wait. Thats the point here?
>> __COMPILER_HALT_OFFSET__ already tells you where the data starts.
> __COMPILER_HALT_OFFSET__ tells you the offset if you are running the
> file. It is only available in the file that does the actual
> __halt_compiler(); statement. When using the Tokenizer (this is what
> this is about; this is *not* about PHP's own lexing/parsing behavior)
> you don't have that constant available.
>
> Though, again, I don't think the second patch is strictly necessary.
> I'd be happy without, if it creates too many problems / is not
> intuitive.
>
> Nikita
>
What I am really hearing in this thread is some people have interest
in a way to easily access the __COMPILER_HALT_OFFSET__ offset from
another file's context. Why don't we simply create a function for
this? Something like get_compiler_halt_offset(filename) or a similar
function specifically for this, maybe a function which returns the
data after the offset or a combination of the two. Whatever solves
these use cases. Then the tokenizer may stay precisely what it is, a
tokenizer. Changing the behavior of the tokenizer based off the
contents of the file seem very incorrect to me.
-Chris