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
Your syntax is invalid in both PHP4 and PHP5. Bugzilla is not a PHP programming forum. http://ch2.php.net/empty