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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC