From: mg at memedia dot de
Operating system: Various
PHP version: 5.0.5
PHP Bug Type: Scripting Engine problem
Bug description: undefined function parse-error in if-clause
Description:
------------
This problem only occurs sometimes. I only had it for 5-8 times, but it
really drives me crazy for now. I can't explain myself to be such a bad
programmer, so it must be a bug.
It occurs sometimes in if clauses like:
if (isset($a) || isset($b)) {
// do something
}
..and PHP returns
"Fatal error: Call to undefined function () in /index.php on line XX"
If the if-clause was "((isset($a)) || (isset($b)))" it helped to remove
the additional parenthesis, and do "(isset($a) || isset($b))2 instead.
Also the error was eliminated in some cases by adding another side to the
expressions, like "((isset($a)==true) || (isset($b)==false))".
But for now I'm really fed up with this:
$a=isset($_GET['action']);
$b=$a && (strpos($_GET['action'], 'admin')===false);
if (($a) || ($b)) {
echo "if it works or not doesn't matter; the question is if it can be
parsed";
}
I tried everything but I can't get that expression to work. In antoher
case i really wrote TWO if-clauses with only one statement that called one
and the same function. Working an above code also revaled that $b becomes
unexptected, when writing:
if ($a || $b) {
echo "if it works or not doesn't matter; the question is if it can be
parsed";
}
Parse error: parse error, unexpected T_VARIABLE in /index.php on line 353
Anyway, that error occurs only in some bunch of code and cannot really be
reproduced with a single file containing above code-snippets.
I appreciate appropiate workarounds for that problem ;)
PHP Version doesn't matter. I had the problem with PHP 4.x and still have
it with 5.04 and 5.1RC3.
--
Edit bug report at http://bugs.php.net/?id=35184&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35184&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35184&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35184&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35184&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35184&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35184&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35184&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35184&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35184&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35184&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35184&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35184&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35184&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35184&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35184&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35184&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35184&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35184&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35184&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35184&r=mysqlcfg