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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
4 + 40 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 05:01:30 2024 UTC