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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Wed Jul 16 23:01:33 2025 UTC