#33632 [NEW]: cannot use "Subject" as classname

From: Date: Sun, 10 Jul 2005 16:51:59 +0000
Subject: #33632 [NEW]: cannot use "Subject" as classname
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81636@lists.php.net to get a copy of this message
From: akorthaus at web dot de Operating system: Linux 2.4.31 (gentoo) PHP version: 5.1.0b2 PHP Bug Type: Scripting Engine problem Bug description: cannot use "Subject" as classname Description: ------------ I have a class called "Subject" which I use for a long time now, but when I tried to use the code with 5.1b2 I got: Fatal error: Cannot redeclare class subject... Simple renaming the class to MailSubject fixes the problem. But I did not redeclare this class, I did a search like "grep -ir subject *" I tried some test-scrips: <?php var_dump(class_exists('Subject')); ?> bool(false) <?php Test {} class Subject { } ?> Fatal error: Cannot redeclare class subject in /var/www/localhost/htdocs/subject.php on line 3 <?php Test {} class Subject extends Test { } ?> Fatal error: Cannot redeclare class subject in /var/www/localhost/htdocs/subject.php on line 4 (If I extend, error is found in line 4, not 3 ?!). I'm using Apache-sapi with Apache 1.3.33. Reproduce code: --------------- <?php class Subject {} ?> Expected result: ---------------- empty page Actual result: -------------- Fatal error: Cannot redeclare class subject in /var/www/localhost/htdocs/subject.php on line 2 -- Edit bug report at http://bugs.php.net/?id=33632&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33632&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33632&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33632&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33632&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33632&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33632&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33632&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33632&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33632&r=support Expected behavior: http://bugs.php.net/fix.php?id=33632&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33632&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33632&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33632&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33632&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33632&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33632&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33632&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33632&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33632&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33632&r=mysqlcfg

« previous php.bugs (#81636) next »