php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69798 ArrayObject / empty()
Submitted: 2015-06-11 12:10 UTC Modified: 2015-06-11 18:16 UTC
From: amobilia at agduc dot com Assigned: cmb (profile)
Status: Not a bug Package: Arrays related
PHP Version: 5.6.9 OS: Centos 7
Private report: No CVE-ID: None
 [2015-06-11 12:10 UTC] amobilia at agduc dot com
Description:
------------
Testing if an arrayobject() is empty() return a bad value

PHP 5.6.9 (cli) (built: May 15 2015 09:31:38)
From http://rpms.remirepo.net/
No specifics changes made to the configuration.
Using php-fpm with nginx (oci8 installed)

Test script:
---------------
<?php
$ao = new ArrayObject();
var_dump(empty($ao));
?>

Expected result:
----------------
bool(true)

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-11 18:16 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-06-11 18:16 UTC] cmb@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.  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.

<http://php.net/manual/en/function.empty.php#refsect1-function.empty-returnvalues> lists what is considered being empty. Use ArrayObject::count() to get the number of elements.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 10 16:01:23 2020 UTC