Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 119345

Summary: PHP parser error
Product: Gentoo Linux Reporter: James Pellow <misc>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: 2005.1   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description James Pellow 2006-01-17 15:45:40 UTC
I have encountered what appears to be a bug in php.  Here are the details:

PHP 4.4.0-pl1-gentoo (cli) (built: Nov  6 2005 18:21:59)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with DBG v2.11.32, (C) 2000,2005, by Dmitri Dmitrienko

The following code does not parse:

$a = array();
$b = array();
$i = array_intersect($a, $b);
if (!empty($i)) echo 'Intersected';
if (!empty(array_intersect($a, $b)) echo 'Also intersected';

The following error is thrown on the second if statement:

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/pellja/test/test.php on line 5
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-01-17 16:09:48 UTC
Your syntax is invalid in both PHP4 and PHP5. Bugzilla is not a PHP programming forum.

http://ch2.php.net/empty