|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #47432 Error message for built-in override is very non-obvious
Submitted: 2009-02-18 02:11 UTC Modified: 2014-12-30 10:41 UTC
From: spam at paulisageek dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: * OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: spam at paulisageek dot com
New email:
PHP Version: OS:


 [2009-02-18 02:11 UTC] spam at paulisageek dot com
If you have a c extension defining certain classes, then defining the same class in user land gives the message :

Fatal error: Cannot redeclare class *classname* in *file* on line *linenum*

This is quite confusing, since most people will know to look through all their user land scripts for the redefinition, and few will actually look at their installed extensions to find conflicts.

I recommend changing the error message to:

Fatal error: Cannot redeclare built-in class *classname* in *file* on line *linenum*

Reproduce code:

class Exception {


Expected result:
Fatal error: Cannot redeclare built-in class *classname* in *file* on line *linenum*

Actual result:
Fatal error: Cannot redeclare class *classname* in *file* on line *linenum*


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-08 20:40 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2014-07-13 22:55 UTC]
-Status: Open +Status: Feedback -PHP Version: 5.2.9RC2 +PHP Version: *
 [2014-07-13 22:55 UTC]
This applies to built in and module functions also. 

This bug is reported for 5.2 and we have namespace now. Is this needed? Distinguishing between built in and user defined class does not give us any benefits. Redefinition is redefinition anyway.
 [2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 05:01:28 2024 UTC