Bug #52410 [Opn->Bgs]: Namespaces affects existing code after upgrade

From: Date: Sun, 25 Jul 2010 16:43:04 +0000
Subject: Bug #52410 [Opn->Bgs]: Namespaces affects existing code after upgrade
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4734@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52410&edit=1 ID: 52410 Updated by: johannes@php.net Reported by: bugs dot php dot net at rootwerk dot de Summary: Namespaces affects existing code after upgrade -Status: Open +Status: Bogus Type: Bug Package: Documentation problem Operating System: Ubuntu 10.04 PHP Version: 5.2.14 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php quoting the migration guide: "The following keywords are now reserved and may not be used in function, class, etc. names. * goto * namespace" http://php.net/manual/en/migration53.incompatible.php Previous Comments: ------------------------------------------------------------------------ [2010-07-23 00:21:06] felipe@php.net In the end of http://docs.php.net/manual/en/migration53.incompatible.php page are mentioned the new keywords introduced in 5.3. But yes, the FAQ. needs an update to state this point. Thanks. ------------------------------------------------------------------------ [2010-07-22 23:49:19] bugs dot php dot net at rootwerk dot de Description: ------------ After upgradeing from php 5.2.4 to 5.3.2 (with ubuntu 10.4), the following code won't work: <?PHP class namespace extends something { } ?> The error message: PHP Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in ... The documentation says: Q: If I don't use namespaces, should I care about any of this? A: No. Namespaces do not affect any existing code in any way ( http://www.php.net/manual/en/language.namespaces.faq.php ) Test script: --------------- <?PHP class namespace extends something { } ?> Expected result: ---------------- in this case, I won't define a php-namespace, but a functionality within my application, which was called so before namespaces existed in php. Actual result: -------------- PHP Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52410&edit=1

« previous php.doc.bugs (#4734) next »