ID:               48930
 Updated by:       ka...@php.net
 Reported By:      adam-phpbugs at adam dot gs
-Status:           Open
+Status:           Assigned
 Bug Type:         Scripting Engine problem
 Operating System: *
 PHP Version:      5.3.0
-Assigned To:      
+Assigned To:      scottmac
 New Comment:

Scott, you worked on the re2c switch, any chance you can clarrify this
one?


Previous Comments:
------------------------------------------------------------------------

[2009-07-15 17:40:49] adam-phpbugs at adam dot gs

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 this bug report at http://bugs.php.net/?id=48930&edit=1

Reply via email to