|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-08-10 11:31 UTC] bear8811 at mail dot com
Description:
------------
function fnc($var) {
static $$var;
}
// Parse error: syntax error, unexpected '$', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /var/www/ex/data/www/ex.com/system/core.php on line 2
Actual result:
--------------
// Parse error: syntax error, unexpected '$', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /var/www/ex/data/www/ex.com/system/core.php on line 2
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 02:00:01 2026 UTC |
What do you need this for? Why cannot your use-case be expressed (more clearly) in terms of a static array? function fnc($var) { static $vars = []; // use $vars[$var] }