note 95567 added to language.variables.variable

From: Date: Sat, 09 Jan 2010 20:10:51 +0000
Subject: note 95567 added to language.variables.variable
Groups: php.notes 
Request: Send a blank email to php-notes+get-164817@lists.php.net to get a copy of this message
Expanding upon the comment by php at ianco dot co dot uk: Variable variables allow the creation of non-standard variables names including those that begin with a number. In the following code: <?php // $variable-name = '42'; // You can't do that but you can do this: $a = '42'; $$a = 'non-standard variable name'; echo ${'42'}; echo $$a; ?> both echo statements are valid and output the following string: non-standard variable name ---- Server IP: 69.147.83.197 Probable Submitter: 24.7.65.38 ---- Manual Page -- http://www.php.net/manual/en/language.variables.variable.php Edit -- https://master.php.net/note/edit/95567 Del: integrated -- https://master.php.net/note/delete/95567/integrated Del: useless -- https://master.php.net/note/delete/95567/useless Del: bad code -- https://master.php.net/note/delete/95567/bad+code Del: spam -- https://master.php.net/note/delete/95567/spam Del: non-english -- https://master.php.net/note/delete/95567/non-english Del: in docs -- https://master.php.net/note/delete/95567/in+docs Del: other reasons-- https://master.php.net/note/delete/95567 Reject -- https://master.php.net/note/reject/95567 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#164817) next »