#23630 [Opn->Bgs]: Variable parsing issue within strings
ID: 23630
Updated by: derick@php.net
Reported By: nicolas at van-lancker dot be
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: Mandrake 9.1
PHP Version: 4.3.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Use echo "{$_GET['foo']}" instead.
Previous Comments:
------------------------------------------------------------------------
[2003-05-14 15:18:06] nicolas at van-lancker dot be
According to the doc :
Variable parsing
When a string is specified in double quotes or with heredoc, variables
are parsed within it.
Testcode :
<html>
<body>
<a href="test.php?MyVar=PHP">Link</a>
<br>
<?php
if($_GET['MyVar']) {
echo "Simple test : $_GET['MyVar']";
}
?>
</body>
</html>
When clicking on the link result :
Link
Simple test :
So the $_GET['MyVar'] variable was not parsed within the string.
Seems to me that this incorrect behaviour...
Or there might be reason to explain this, but then it should be noted
in the documentation...?
Greetz,
Nicolas
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23630&edit=1
Thread (2 messages)