I think this has merit especially when you consider the heredoc syntax.  Many 
of my queries are in heredoc for the sakes of readability and cleansliness.  
However, the cases are rare in which I would do so.

Rather, with offsets and other variables in queries it makes more sense for 
variables as application architecture would be better off with those values to 
be changed and likely in a future application feature the users might want to 
change the information.

I see constants more for internal classes and handling internal behavior.  In 
which at that point this does become rather useless.

Regards,

Mike Willbanks
Sent via BlackBerry from T-Mobile

-----Original Message-----
From: "Richard Black" <[EMAIL PROTECTED]>

Date: Wed, 29 Oct 2008 10:51:13 
To: Josh<[EMAIL PROTECTED]>
Cc: <internals@lists.php.net>
Subject: RE: [PHP-DEV] Constants in double-quoted strings

I think this would have been a useful feature if it had always been there... 
like variable names being translated inside double quoted strings. 

But to add it now would, as has been pointed out, have a good chance of 
breaking a lot of existing code, and for that reason I think it's probably a 
non-starter.


========================================== 
Richard Black - Senior Consultant
DataVisibility Ltd
Tel. 020 7917 9570
http://www.datavisibility.com/
--------------------------------------------------------------------------------------------
Registered Office: 212 Piccadilly, London, W1J 9HF
Registered in England No. 5891154
VAT No. 8877891834
 
This document should only be read by those persons to whom it is addressed. Its 
contents are 
private and confidential. If you receive this email in error, please notify the 
sender immediately 
and do not disclose, copy or distribute this message, or open any attachments.


-----Original Message-----
From: Josh [mailto:[EMAIL PROTECTED] 
Sent: 29 October 2008 10:45
To: Dave Ingram
Cc: Paweł Stradomski; internals@lists.php.net; Arvids Godjuks
Subject: Re: [PHP-DEV] Constants in double-quoted strings

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 <[EMAIL PROTECTED]> 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
>

--
PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: 
http://www.php.net/unsub.php


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to