Bug #16298: Arrays being called in a function() call produces unexpected error.

From: Date: Wed, 27 Mar 2002 02:10:02 +0000
Subject: Bug #16298: Arrays being called in a function() call produces unexpected error.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-3441@lists.php.net to get a copy of this message
From: m4a1_damien@hotmail.com Operating system: WinXP PHP version: 4.1.2 PHP Bug Type: Unknown/Other Function Bug description: Arrays being called in a function() call produces unexpected error. When making a simple function... <?php function include_page ($script_prefs[templated_file]) { $script_prefs["templated_file_extension"] = substr ($script_prefs["templated_file"], strrpos ($script_prefs["templated_file"], ".") +1); if (($script_prefs["templated_file_extension"] != "php") || (eregi ("^[_a-z0-9-]+$", $script_prefs["templated_file"])) || (file_exists ("C:\\Apache\\htdocs\\templates\\" . $script_prefs["templated_file"]))) { include_once ("C:\\Apache\\htdocs\\templates\\" . $script_prefs["templated_file"]); } else { include_once ("C:\\Apache\\htdocs\\templates\\error.php"); } return; } ?> (Small scale beta templating system) When you call the function include_page function with a normal variable... i.e. "function include_page($variable)" the function works find... ...but... If you use it with a variable... i.e. "function include_page($script_pref["variable"])" the webpage produces the following... Parse error: parse error, expecting `')'' in c:\apache\htdocs\index.php on line 2 I have rewritten the function name sveral times, and in diffrent forms.. with 's and without.. but no change.. only when you use a variable inside a array... My PHP.ini has full error reporting, a debugging mode switched on (startup errors etc on) -- Edit bug report at http://bugs.php.net/?id=16298&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16298&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16298&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16298&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16298&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16298&r=support Expected behavior: http://bugs.php.net/fix.php?id=16298&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16298&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16298&r=submittedtwice

« previous php.bugs (#3441) next »