note 98130 deleted from function.halt-compiler by danbrown
| From: | danbrown@php.net | Date: | Thu, 27 May 2010 15:52:39 +0000 |
| Subject: | note 98130 deleted from function.halt-compiler by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169656@lists.php.net to get a copy of this message | ||
Note Submitter: daniel dot haas at cn-consult dot eu
----
As reported in http://bugs.php.net/bug.php?id=48930 there is a Bug
in PHP >=5.3 when using __halt_compiler() in php-files that have a shebang (for example:
#/usr/bin/php) at the top of the file so that it is executable. The shebang is not correctly
considered in __COMPILER_HALT_OFFSET_, and so the offset is wrong. In PHP 5.2.x this worked fine.
This is just a heads-up so that people encountering strange issues with it have a chance to see it.
(I had to search a while and scratch my head to find the issue).
The workaround we implemented, is to look at the first batch of bytes after the offset, and if they
contain parts of __halt_compiler() the offset ist wrong. You may then correct the offset by the
length of the shebang you use. Using this way the code works in PHP 5.2 and 5.3, even if the Bug
gets fixed someday in the future.