php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42541 Check for namespace decl. on first line doesn't work when extended info is on
Submitted: 2007-09-04 10:00 UTC Modified: 2007-09-05 07:25 UTC
From: derick@php.net Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 6CVS-2007-09-04 (CVS) OS: Linux
Private report: No CVE-ID: None
 [2007-09-04 10:00 UTC] derick@php.net
Description:
------------
When extended info is enabled (to generate EXT_* opcodes for debuggers), the namespace decl. on the first line check is not correct (zend_compile.c:5049)

Reproduce code:
---------------
Just any file with a namespace decl, for example: Zend/tests/ns_010.php

Run as:
php -n -e /home/derick/dev/php/php-6.0dev/Zend/tests/ns_010.php

Expected result:
----------------
class ok
class ok
class ok
class ok
method ok
method ok
method ok
method ok
const ok
const ok
const ok
const ok
var ok
var ok
var ok
var ok


Actual result:
--------------
Fatal error: Namespace declaration statement has to be the very first statement in the script in /home/derick/dev/php/php-6.0dev/Zend/tests/ns_010.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-04 10:00 UTC] derick@php.net
Dmitry, could you please check this?
 [2007-09-05 07:25 UTC] dmitry@php.net
This bug has been fixed in CVS.

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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 09:01:31 2024 UTC