Re: Namespaces and \t, \r, \n, \0 etc.

From: Date: Tue, 28 Oct 2008 19:30:25 +0000
Subject: Re: Namespaces and \t, \r, \n, \0 etc.
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-41537@lists.php.net to get a copy of this message
What about just silently converting newline to '\n' and tab to '\t', etc. I mean if you cant put those characters in a string, who will notice? or better, just use a single-quoted string. Regards, Josh On Wed, Oct 29, 2008 at 1:28 AM, Marcus Boerger <helly@php.net> wrote: > Hello Stefan, > > If the engine fails to lookup a class and detected a namespace separator > we could actually add this check as well and suggest it as a probable cause > of the error. > > marcus > > Tuesday, October 28, 2008, 1:49:00 PM, you wrote: > >> 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 > > > > > Best regards, > Marcus > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#41537) next »