php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #35250 string variable expansion on demand
Submitted: 2005-11-17 03:11 UTC Modified: 2015-01-08 23:52 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: jellicle at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: * OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-11-17 03:11 UTC] jellicle at gmail dot com
Description:
------------
Wishlist: ability to expand variables in an arbitrary string, which does not seem to be possible currently.  (well, not easily, anyway).

Reproduce code:
---------------
$cat = 'calico';
$hat = 'chapeau';
$string = 'The $cat in the $hat.'; //note single quotes
$string = expand_var($string); //this wishlist function
echo $string;


Expected result:
----------------
The calico in the chapeau.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-08 23:52 UTC] ajf@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2015-01-08 23:52 UTC] ajf@php.net
This is basically eval(), and eval() is rather evil so I don't see this being added.
 [2015-01-08 23:52 UTC] ajf@php.net
-Operating System: Linux +Operating System: * -PHP Version: 5.0.5 +PHP Version: *
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 10:01:29 2024 UTC