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
 [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: Fri Apr 26 10:01:31 2024 UTC