php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #20454 isset(eval("\$var".$n.";")) ===>> CRASH!!!
Submitted: 2002-11-15 20:44 UTC Modified: 2002-11-16 01:58 UTC
From: manogarc at hotmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.3 OS: Windows NT 5
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: manogarc at hotmail dot com
New email:
PHP Version: OS:

 

 [2002-11-15 20:44 UTC] manogarc at hotmail dot com
In this example, i?m triying to recover an indeterminate number of vars from a form with the code below. The type of vars is like this: $var1, $var2, $var3, ... but the succesion can be incomplete like this $var1, $var5, $var6, ...

for ($n=0; n<=10; $n++) {
   if (isset(eval("\$var".$n.";")) {
      [...]
   }
}

and the error message is:
Parse error: parse error, unexpected T_EVAL, expecting T_VARIABLE or '$' in d:\inetpub\wwwroot\administracion\val_empextdb.php on line 14

Thanks.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-16 01:58 UTC] philip@php.net
This is now further documented with a <note>.  Documentation changes to this function can be seen here:

http://cvs.php.net/cvs.php/phpdoc/en/reference/var/functions/isset.xml

isset() only takes on variables, thanks for the report.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC