Bug #75827 [Opn->Nab]: Variables with space, how is it possible?
| From: | requinix@php.net | Date: | Wed, 17 Jan 2018 04:19:29 +0000 |
| Subject: | Bug #75827 [Opn->Nab]: Variables with space, how is it possible? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213574@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75827&edit=1
ID: 75827
Updated by: requinix@php.net
Reported by: vini_000 at live dot com
Summary: Variables with space, how is it possible?
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Windows
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Protip: don't do weird things with variable variables.
Previous Comments:
------------------------------------------------------------------------
[2018-01-17 03:20:37] spam2 at rhsoft dot net
thisis a *bugtracker* and not https://stackoverflow.com/
however:
$test = "testing test";
$$test = "5";
echo $$test;
echo "${'testing test'}";
------------------------------------------------------------------------
[2018-01-17 01:54:09] vini_000 at live dot com
Description:
------------
You can create variables with the name entered in another variable. But if the name has space, how
can you reference it?
Test script:
---------------
$test = "testing test";
$$test = "5";
echo $$test; // result: 5
echo $testing test //this can not
/*Now with a variable with no space*/
$test = "testing";
$$test = "5";
echo $testing; //result:5
echo $$test; //result:5
/*How can I reference a variable as an example (testing test)?*/
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75827&edit=1