php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11449 it is not possible to declare a static variable variable
Submitted: 2001-06-12 20:23 UTC Modified: 2001-06-15 06:54 UTC
From: lasconi at free dot fr Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.5 OS: linux and windows98
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: lasconi at free dot fr
New email:
PHP Version: OS:

 

 [2001-06-12 20:23 UTC] lasconi at free dot fr
this script produces a parse error:

function test(){
$a="a";
static $$a;
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-15 06:54 UTC] zeev@php.net
Static variables are a 'feature' of the function, and are declared in compile-time.  Since it's impossible to know their name in compile-time, it's not possible to use varying expression as the static variable name.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 00:01:29 2025 UTC