Hello,

On Thu, Sep 15, 2011 at 8:13 AM, Nikita Popov <nikita....@googlemail.com> wrote:
> On Thu, Sep 15, 2011 at 5:05 PM, Hannes Magnusson
> <hannes.magnus...@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

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

Reply via email to