Re: HALT Patch

From: Date: Sat, 12 Mar 2005 11:58:51 +0000
Subject: Re: HALT Patch
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-15396@lists.php.net to get a copy of this message
Moriyoshi Koizumi wrote:
I modified your patch so it can capture the position where the supposed data begins into the constant __HALT_PHP_PARSER__.
Sounds like a good idea to me as all the manual work to guess the start of the data look a bit kludgy to me.
<?php $fp = fopen(__FILE__, 'rb'); fseek($fp, __HALT_PHP_PARSER__, SEEK_SET); fpassthru($fp); ?> <?php __HALT_PHP_PARSER__; ?> abc def
Hmm.. I was wondering if we should go one step further and also provide a stream to the data. If the most common usage of this construct is going to be reading the data after __HALT_PHP_PARSER__ then we should optimize for that case. Something like <?php $data = gzdeflate(file_get_contents("php://data")); ?> <?php __DATA__; ?> ... - Chris

« previous php.internals (#15396) next »