php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #7728 Dynamic function names
Submitted: 2000-11-09 11:05 UTC Modified: 2000-11-09 11:19 UTC
From: ignacio at openservices dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.3pl1 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: ignacio at openservices dot net
New email:
PHP Version: OS:

 

 [2000-11-09 11:05 UTC] ignacio at openservices dot net
The following works:
"""
$abc="ABC";
$t=$abc."123";
$t(); // Calls ABC123()
"""
but there's no obviously apparent reason that:
"""
$abc="ABC";
($abc."123")();  // Calls ABC123()
"""
shouldn't work the same way.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-09 11:14 UTC] derick@php.net
You can use:

${$abc."123"}

note the curly braces.
So there is no need for this "feature".
 [2000-11-09 11:19 UTC] ignacio at openservices dot net
Umm...no. That attempts to call $ABC123(), which is not the same thing.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 12:00:02 2026 UTC