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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Thu Dec 26 14:01:30 2024 UTC