php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #228 echo $value and echo $$value
Submitted: 1998-04-02 01:15 UTC Modified: 1998-04-02 09:10 UTC
From: steve at eyekon dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0 Release Candidate 3 OS: Solaris 2.6 Sun
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: steve at eyekon dot com
New email:
PHP Version: OS:

 

 [1998-04-02 01:15 UTC] steve at eyekon dot com
Here is a short script which works fine in PHP 2 but not in 3. I have looked in the FAQ and the bug database, but did not see anything on this particular problems:

<?
$new = "One";
$$new = "Two";
echo "1: $new<br>2: $$new<br>";
echo "1: $new<br>2: $One<br>";
?>

on PHP3 produces the output: (bad.. I think)

1: One
2: $One
1: One
2: Two

and on PHP2 produces: (Good... or was)

1: One
2: Two
1: One
2: Two

So... is this a bug or feature? Sorry if it's been covered!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-04-02 09:10 UTC] andi
In PHP 3.0 you can use ${$value}.             
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 03:03:42 2022 UTC