#20740 [NEW]: unable to use a variable from an array when creating function
| From: | matt at mattd dot org | Date: | Sat, 30 Nov 2002 22:57:30 +0000 |
| Subject: | #20740 [NEW]: unable to use a variable from an array when creating function | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-26256@lists.php.net to get a copy of this message | ||
From: matt@mattd.org
Operating system: RedHat Linux 8.0
PHP version: 4.2.2
PHP Bug Type: Scripting Engine problem
Bug description: unable to use a variable from an array when creating function
Hi
when calling a function:
$restricted = check_restriction($row_person['restriction_code']);
I run into a problem.
The function is defined as:
function check_restriction($row_person['restriction_code'] )
It would appear that i can't use the array variable
$row_person['restriction_code'] in this definition.
the error message:
"Parse error: parse error, unexpected '[', expecting ')'"
When creating a seperate variable from this array, it works fine...
Thanks
--
Edit bug report at http://bugs.php.net/?id=20740&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20740&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20740&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20740&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20740&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20740&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20740&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20740&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20740&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20740&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20740&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20740&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20740&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20740&r=isapi