Req #47432 [Opn->Fbk]: Error message for built-in override is very non-obvious

From: Date: Sun, 13 Jul 2014 22:55:17 +0000
Subject: Req #47432 [Opn->Fbk]: Error message for built-in override is very non-obvious
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186601@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=47432&edit=1

 ID:                 47432
 Updated by:         yohgaki@php.net
 Reported by:        spam at paulisageek dot com
 Summary:            Error message for built-in override is very
                     non-obvious
-Status:             Open
+Status:             Feedback
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 Operating System:   *
-PHP Version:        5.2.9RC2
+PHP Version:        *
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2009-02-18 02:11:51] spam at paulisageek dot com

Description:
------------
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:
---------------
<?php

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*


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=47432&edit=1


Thread (3 messages)

« previous php.bugs (#186601) next »