php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23630 Variable parsing issue within strings
Submitted: 2003-05-14 15:18 UTC Modified: 2003-05-14 15:23 UTC
From: nicolas at van-lancker dot be Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.3.1 OS: Mandrake 9.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nicolas at van-lancker dot be
New email:
PHP Version: OS:

 

 [2003-05-14 15:18 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-14 15:23 UTC] derick@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 02:01:30 2024 UTC