php.net |  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
 [2008-07-31 16:41 UTC] ydeg71 at tiscali dot it
Description:
------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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 09 12:01:29 2020 UTC