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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jellicle at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 00:01:34 2025 UTC