php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78526 Bad return value signature of SimpleXMLElement::xpath
Submitted: 2019-09-11 11:40 UTC Modified: 2019-09-11 17:05 UTC
From: yann dot rabiller at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: SimpleXML related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2019-09-11 11:40 UTC] yann dot rabiller at gmail dot com
Description:
------------
---
From manual page: https://php.net/simplexmlelement.xpath
---

The signature of the xpath method as given in the documentation is:

`public SimpleXMLElement::xpath ( string $path ) : array`

This means an array is necessarily returned from the method.
On the other hand, when reading the return values in the same page, I see:

>  Returns an array of SimpleXMLElement objects or FALSE in case of an error. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-11 17:05 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2019-09-11 17:05 UTC] cmb@php.net
> This means an array is necessarily returned from the method.

No, see <https://www.php.net/manual/en/functions.internal.php>.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Dec 03 20:05:54 2022 UTC