|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45667 isset() cannot be used with argv[] , returns unrelated error msg
Submitted: 2008-07-31 16:41 UTC Modified: 2008-07-31 16:57 UTC
From: ydeg71 at tiscali dot it Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.2.6 OS: Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: ydeg71 at tiscali dot it
New email:
PHP Version: OS:


 [2008-07-31 16:41 UTC] ydeg71 at tiscali dot it
Using isset() on argv[1] from the CLI results in error message referring to the "?:" operator.

Reproduce code:
<? if (isset(argv[1])) echo "it's set"; ?>

Expected result:
Either nothing or the "it's set" string output on STDOUT

Actual result:
PHP Parse error:  syntax error, unexpected '[', expecting T_PAAMAYIM_NEKUDOTAYIM in /home/ydeg/- on line 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-31 16:51 UTC] ydeg71 at tiscali dot it
Forget the isset(). *Any* reference to argv[] triggers the error. Wondering how the heck I'm gonna check for command line arguments.
 [2008-07-31 16:56 UTC] ydeg71 at tiscali dot it
D'OH... Missing $. Sorry for the noise. Please delete the whole thing if at all possible.
 [2008-07-31 16:57 UTC] ydeg71 at tiscali dot it
But still... why the unrelated error message? That didn't help.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Sep 30 10:01:23 2020 UTC