#45667 [Opn]: isset() cannot be used with argv[] , returns unrelated error msg

From: Date: Thu, 31 Jul 2008 16:51:51 +0000
Subject: #45667 [Opn]: isset() cannot be used with argv[] , returns unrelated error msg
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127443@lists.php.net to get a copy of this message
ID: 45667 User updated by: ydeg71 at tiscali dot it Reported By: ydeg71 at tiscali dot it Status: Open Bug Type: Arrays related Operating System: Linux PHP Version: 5.2.6 New Comment: Forget the isset(). *Any* reference to argv[] triggers the error. Wondering how the heck I'm gonna check for command line arguments. Previous Comments: ------------------------------------------------------------------------ [2008-07-31 16:41:54] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45667&edit=1

« previous php.bugs (#127443) next »