php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11512 Parsing of vars inside a string
Submitted: 2001-06-16 03:16 UTC Modified: 2001-06-16 12:04 UTC
From: luci at conexim dot com dot au Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0.5 OS: RH Linux
Private report: No CVE-ID: None
 [2001-06-16 03:16 UTC] luci at conexim dot com dot au
$varone="blah";
$vartwo="$varone_foo";

=> The resulting contents of $vartwo is not "blah_foo" as expected. You can only get the desired result by having $vartwo= $varone . "_foo";

However something like $vartwo="foo_$varone" works as expected => "foo_blah";

Is this a language construct issue perhaps?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-16 12:04 UTC] sniper@php.net
No, _ is allowed in variable names.
$varone_foo is thought to be a variable.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC