From:             [EMAIL PROTECTED]
Operating system: Linux 2.4
PHP version:      4.3.0
PHP Bug Type:     Scripting Engine problem
Bug description:  array_intersect with empty in IF statement

$array1 = array ("a" => "green", "red", "blue");
$array2 = array ("b" => "green", "yellow", "red");

if (false == empty(array_intersect ($array1, $array2)))
{
        echo 1; 
}

Log output:
PHP Parse error:  parse error, unexpected T_STRING, expecting T_VARIABLE
or '$' in /var/www/test/arint.php on line 6

line 6 is the line with IF statement.

However the following code works perfectly:

$array1 = array ("a" => "green", "red", "blue");
$array2 = array ("b" => "green", "yellow", "red");
$result = array_intersect ($array1, $array2);

if (false == empty($result))
{
        echo 1; 
}

-- 
Edit bug report at http://bugs.php.net/?id=21942&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=21942&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=21942&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=21942&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=21942&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=21942&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=21942&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=21942&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=21942&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=21942&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=21942&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21942&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=21942&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=21942&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=21942&r=gnused

Reply via email to