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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 13:01:31 2024 UTC