Re: Namespaces and \t, \r, \n, \0 etc.
| From: | Stefan Priebsch | Date: | Tue, 28 Oct 2008 12:49:00 +0000 |
| Subject: | Re: Namespaces and \t, \r, \n, \0 etc. | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41509@lists.php.net to get a copy of this message | ||
Hi Johannes,
Johannes Schlüter schrieb:
>> to me it does not seem to make sense to use tabs or linefeeds (or
>> whatever other strange escaped characters) in namespace'd names. So I'd
>> suggest generating a fatal error when somebody uses them.
>
> \n is no newline (yes "\n" is, \n not ...) -> no need for such a strange
> limitation.
My suggestion is to try to avoid people running into trouble with
something like:
namespace the\namespace\class;
$classname = "the\namespace\class";
new $classname;
I'd prefer the new statement to fail with an error like "you can't have
newlines in a classname" instead of not finding $classname.
Regards,
Stefan
--
>e-novative> - We make IT work for you.
http://www.e-novative.de
e-novative GmbH - Poignring 24 - 82515 Wolfratshausen - Germany
tel/phone +49 (0)8171 267 087 0 - fax +49 (0)8171 267 087 5
Handelsregister/Trade Register: Amtsgericht München HRB 139407
Sitz/Registered Office: Wolfratshausen
Geschäftsführer/Executive: Dipl. Inform. Stefan Priebsch
GnuPG Key: 0x7DB67F7F