Re: Constants in double-quoted strings

From: Date: Wed, 29 Oct 2008 10:45:29 +0000
Subject: Re: Constants in double-quoted strings
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-41550@lists.php.net to get a copy of this message
Dave, how is a variable name any less a bareword than a constant name? Thats what the backets were for, perhaps combined with a symbol to make it even less likely, and of course if the constant is not found in the symbol table, the constant name would be outputted directly. On Wed, Oct 29, 2008 at 8:23 PM, Dave Ingram <dave@dmi.me.uk> wrote: > >> I only worry it could break BC - people might have used "{SOMETEXT}" in >> strings and not expect it to be interpolated (I've done so myself). >> > I've done that a lot, and I've seen quite a bit of templating code that > does the same. > > My personal opinion is that interpolating constants would just lead to > trouble, one way or another. Even something like "{#SOMETEXT}" could be > problematic. I would definitely discourage interpolation without some > sort of sigil though... barewords (in brackets or not) are too likely to > break BC. > > > Dave >

« previous php.internals (#41550) next »