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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2023 The PHP Group
All rights reserved.
Last updated: Tue Jan 31 07:05:53 2023 UTC