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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yann dot rabiller at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC