|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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: Thu Jul 16 14:01:26 2020 UTC