Re: strange string evaluation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marten Lehmann wrote:
Hello,

with PHP 5.0.x this two lines of code returned "{TEST}":

$var = "TEST";
print "\{$var}";

But with PHP 5.2.x, the same code returns "\{TEST}"

If I remove the backslash:

$var = "TEST";
print "{$var}";

then just "TEST" is return (without any brackets).

What is the recommended way for PHP 5.2.x to work with that? It looks a bid odd if I have to write

print "{". $var. "}";

instead.



$var = 'TEST';
print "{{$var}}";




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux