#45067 [Opn->Bgs]: empty(array_diff(...)) cause Fatal error
| From: | colder@php.net | Date: | Thu, 22 May 2008 16:02:22 +0000 |
| Subject: | #45067 [Opn->Bgs]: empty(array_diff(...)) cause Fatal error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125195@lists.php.net to get a copy of this message | ||
ID: 45067
Updated by: colder@php.net
Reported By: jjahson at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Reproducible crash
Operating System: WXP(sp3),OSX 10.5.2,FreeBSD 6.3
PHP Version: 5.2.6
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. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
empty() works on variables, not expressions.
Previous Comments:
------------------------------------------------------------------------
[2008-05-22 15:40:45] jjahson at gmail dot com
Description:
------------
I tried to compare two arrays and check result for emptyness - all
these in one line, but instead I got a Fatal error.
If I assign return value of array_diff to variable and then check its
emptyness - it works just like I expect.
Reproduce code:
---------------
<?php empty(array_diff(array(1,2), array(1,2))); ?>
Expected result:
----------------
true
Actual result:
--------------
Fatal error: Can't use function return value in write context in
example.php on line 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45067&edit=1