Edit report at http://bugs.php.net/bug.php?id=48930&edit=1
ID: 48930
User updated by: adam-phpbugs at adam dot gs
Reported by: adam-phpbugs at adam dot gs
Summary: __COMPILER_HALT_OFFSET__ incorrect in PHP>=5.3
Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: *
PHP Version: 5.3, 6
Assigned To: felipe
New Comment:
I lied, It just hasn't hit the snapshots yet, works from SVN sources!
-=[~/Scripts/compile/php-src-5.3]=- -=[Sun Jun 27]=- -=[18:40:12]=-
[adam@nighe]$ ./sapi/cli/php test-with-shebang.php
string(19) "
this is test data
"
-=[~/Scripts/compile/php-src-5.3]=- -=[Sun Jun 27]=- -=[18:40:17]=-
[adam@nighe]$ ./sapi/cli/php test-without-shebang.php
string(19) "
this is test data
"
Thanks very much felipe!
Previous Comments:
------------------------------------------------------------------------
[2010-06-28 00:16:40] adam-phpbugs at adam dot gs
Hi felipe,
Thanks for taking a look at this bug, its languished for (what i'd
consider) far
too long.
Unfortunately it doesn't seem to fix the issue:
-=[~/Scripts/compile/php5.3-201006272030]=- -=[Sun Jun 27]=-
-=[18:14:16]=-
[adam@nighe]$ ./sapi/cli/php -v
PHP 5.3.3RC2-dev (cli) (built: Jun 27 2010 17:54:04)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
-=[~/Scripts/compile/php5.3-201006272030]=- -=[Sun Jun 27]=-
-=[18:15:11]=-
[adam@nighe]$ php -v
PHP 5.3.1 (cli) (built: Dec 26 2009 19:21:45)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
-=[~/Scripts/compile/php5.3-201006272030]=- -=[Sun Jun 27]=-
-=[18:15:15]=-
[adam@nighe]$ ./sapi/cli/php test-without-shebang.php
string(19) "
this is test data
"
-=[~/Scripts/compile/php5.3-201006272030]=- -=[Sun Jun 27]=-
-=[18:15:30]=-
[adam@nighe]$ ./sapi/cli/php test-with-shebang.php
string(40) ");
__halt_compiler();
this is test data
"
-=[~/Scripts/compile/php5.3-201006272030]=- -=[Sun Jun 27]=-
-=[18:15:34]=-
[adam@nighe]$ php test-with-shebang.php
string(40) ");
__halt_compiler();
this is test data
"
-=[~/Scripts/compile/php5.3-201006272030]=- -=[Sun Jun 27]=-
-=[18:15:38]=-
[adam@nighe]$ php test-without-shebang.php
string(19) "
this is test data
"
-=[~/Scripts/compile/php5.3-201006272030]=- -=[Sun Jun 27]=-
-=[18:15:44]=-
[adam@nighe]$ cat test-without-shebang.php
<?php
$fh=fopen(__FILE__,"r");
fseek($fh,__COMPILER_HALT_OFFSET__);
var_dump(fread($fh,1024));
fclose($fh);
__halt_compiler();
this is test data
-=[~/Scripts/compile/php5.3-201006272030]=- -=[Sun Jun 27]=-
-=[18:15:54]=-
[adam@nighe]$ cat test-with-shebang.php
#!/usr/local/bin/php
<?php
$fh=fopen(__FILE__,"r");
fseek($fh,__COMPILER_HALT_OFFSET__);
var_dump(fread($fh,1024));
fclose($fh);
__halt_compiler();
this is test data
------------------------------------------------------------------------
[2010-06-27 23:46:18] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=300789
Log: - Fixed bug #48930 (__COMPILER_HALT_OFFSET__ incorrect in PHP >=
5.3)
------------------------------------------------------------------------
[2010-06-27 23:46:12] felipe@php.net
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2010-05-26 11:32:44] daniel dot haas at cn-consult dot eu
We also hit this bug, because we have a custom php-based installer that
uses __halt_compiler() and __COMPILER_HALT_OFFSET__ to extract a tar.gz
portion of the installer.
Since PHP 5.3 our installers do not work anymore! :-(
Is a fix not even planned at this stage??
------------------------------------------------------------------------
[2009-09-09 20:02:00] jani@php.net
Nevermind, of course it's still borked since the check is NOT done in
scanner. :)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=48930--
Edit this bug report at http://bugs.php.net/bug.php?id=48930&edit=1