Edit report at https://bugs.php.net/bug.php?id=21942&edit=1
ID: 21942 Updated by: ni...@php.net Reported by: verx at implix dot com Summary: array_intersect with empty in IF statement -Status: Open +Status: Closed Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: Linux 2.4 PHP Version: 4.3.0 -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: Using empty() on function call results will be possible in PHP 5.5. For more info see https://wiki.php.net/rfc/empty_isset_exprs. Previous Comments: ------------------------------------------------------------------------ [2003-01-30 08:45:17] hholz...@php.net Feature Request: have a meaningful (not to 'us' but to 'them') error message here ... ------------------------------------------------------------------------ [2003-01-29 08:00:31] der...@php.net 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. ------------------------------------------------------------------------ [2003-01-29 07:59:20] verx at implix dot 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 https://bugs.php.net/bug.php?id=21942&edit=1