From:             adam-phpbugs at adam dot gs
Operating system: Any
PHP version:      5.3.0
PHP Bug Type:     Scripting Engine problem
Bug description:  __COMPILER_HALT_OFFSET__ incorrect in PHP>=5.3

Description:
------------
Starting in PHP 5.3.0, php no longer includes the shebang when 
calculating the __COMPILER_HALT_OFFSET__.

Reproduce code:
---------------
#!/usr/bin/php
<?php
printf("__COMPILER_HALT_OFFSET__ is %d\n",__COMPILER_HALT_OFFSET__);


__halt_compiler();


Expected result:
----------------
-=[~]=- -=[Wed Jul 15]=- -=[13:35:18]=-
[a...@nighe]$ php  -v
PHP 5.3.0 (cli) (built: Jul  7 2009 15:11:49) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

-=[~]=- -=[Wed Jul 15]=- -=[13:35:52]=-
[a...@nighe]$ php-stock -v
PHP 5.2.8 (cli) (built: Feb  5 2009 21:21:13) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

-=[~]=- -=[Wed Jul 15]=- -=[13:37:38]=-
[a...@nighe]$ php test.php 
__COMPILER_HALT_OFFSET__ is 94

-=[~]=- -=[Wed Jul 15]=- -=[13:37:39]=-
[a...@nighe]$ php-stock test.php
__COMPILER_HALT_OFFSET__ is 109


The latter answer in this case is correct, the shebang from the above 
example is exactly 15 bytes with the newline, 109-15 == 94. So PHP is 
not including the shebang in the __COMPILER_HALT_OFFSET__ calculation.

Actual result:
--------------
94!

-- 
Edit bug report at http://bugs.php.net/?id=48930&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48930&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48930&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48930&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48930&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48930&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48930&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48930&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48930&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48930&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48930&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48930&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48930&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48930&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48930&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48930&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48930&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48930&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48930&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48930&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48930&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48930&r=mysqlcfg

Reply via email to