#21942 [Opn->Bgs]: array_intersect with empty in IF statement
| From: | derick@php.net | Date: | Wed, 29 Jan 2003 14:00:32 +0000 |
| Subject: | #21942 [Opn->Bgs]: array_intersect with empty in IF statement | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-31577@lists.php.net to get a copy of this message | ||
ID: 21942
Updated by: derick@php.net
Reported By: verx@implix.com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux 2.4
PHP Version: 4.3.0
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
read the docs @ php.net/empty again.
Previous Comments:
------------------------------------------------------------------------
[2003-01-29 07:59:20] verx@implix.com
$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 this bug report at http://bugs.php.net/?id=21942&edit=1