Welcome! Log In Create A New Profile

Advanced

[PHP-DEV] Namespaces and \t, \r, \n, \0 etc.

Posted by Stefan Priebsch 
Stefan Priebsch
[PHP-DEV] Namespaces and \t, \r, \n, \0 etc.
October 27, 2008 10:05AM
Hi list,

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.

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
Johannes Schl
Re: [PHP-DEV] Namespaces and \t, \r, \n, \0 etc.
October 27, 2008 01:35PM
On Mon, 2008-10-27 at 10:02 +0100, Stefan Priebsch wrote:
> Hi list,
>
> 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.

johannes




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Stefan Priebsch
Re: [PHP-DEV] Namespaces and \t, \r, \n, \0 etc.
October 28, 2008 01:50PM
Hi Johannes,

Johannes Schl
Marcus Boerger
Re: [PHP-DEV] Namespaces and \t, \r, \n, \0 etc.
October 28, 2008 04:00PM
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
Josh
Re: [PHP-DEV] Namespaces and \t, \r, \n, \0 etc.
October 28, 2008 08:35PM
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 <[email protected]> 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
Nate Gordon
Re: [PHP-DEV] Namespaces and \t, \r, \n, \0 etc.
October 28, 2008 11:00PM
On Tue, Oct 28, 2008 at 2:30 PM, Josh <[email protected]> wrote:

> 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.
>

Random programmer here, but I really can't agree with silently converting
them. The less automagic foo that acts as a safety net, the better. Or do
we need to revisit gpc_magic_quotes? This theoretically shouldn't happen on
live code if it was tested at least once. But I am all for smart error
messages and single quotes. It will bite everyone at least once, and then
they will learn.

--
-Nathan Gordon

If the database server goes down and there is no code to hear it, does it
really go down?
<esc>:wq<CR>
Sorry, only registered users may post in this forum.

Click here to login