php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43126 Unexpected T_STATIC in parser error
Submitted: 2007-10-29 12:39 UTC Modified: 2007-11-11 22:14 UTC
From: felipe@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2007-10-29 (snap) OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: felipe@php.net
New email:
PHP Version: OS:

 

 [2007-10-29 12:39 UTC] felipe@php.net
Description:
------------
The parser error said: "expecting ... T_STATIC" in class and interface declarations when used keywords in 'extends' or 'implements'.

Eg.
extends use
extends import
extends namespace
extends extends
extends class

With 'extends static' show:
Fatal error: Cannot use 'static' as class name as it is reserved in ...

Reproduce code:
---------------
class foo extends namespace {
}


Expected result:
----------------
Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING or T_PAAMAYIM_NEKUDOTAYIM


Actual result:
--------------
Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING or T_STATIC or T_PAAMAYIM_NEKUDOTAYIM 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-11 22:14 UTC] johannes@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.

I've committed Etienne's patch
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 15:01:36 2025 UTC