note 98132 added to function.halt-compiler
| From: | Shyru at osu1 dot php dot net | Date: | Thu, 27 May 2010 15:50:52 +0000 |
| Subject: | note 98132 added to function.halt-compiler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169653@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 85.214.154.209
Probable Submitter: 87.139.93.214
----
Manual Page -- http://www.php.net/manual/en/function.halt-compiler.php
Edit -- https://master.php.net/note/edit/98132
Del: integrated -- https://master.php.net/note/delete/98132/integrated
Del: useless -- https://master.php.net/note/delete/98132/useless
Del: bad code -- https://master.php.net/note/delete/98132/bad+code
Del: spam -- https://master.php.net/note/delete/98132/spam
Del: non-english -- https://master.php.net/note/delete/98132/non-english
Del: in docs -- https://master.php.net/note/delete/98132/in+docs
Del: other reasons-- https://master.php.net/note/delete/98132
Reject -- https://master.php.net/note/reject/98132
Search -- https://master.php.net/manage/user-notes.php