note 88203 deleted from function.xpath-eval-expression by sobak
| From: | sobak@php.net | Date: | Tue, 22 Nov 2016 03:44:57 +0000 |
| Subject: | note 88203 deleted from function.xpath-eval-expression by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207435@lists.php.net to get a copy of this message | ||
Note Submitter: trotters213 at msn dot com
----
For those who use PHP5 and the domxml module of PECL : this function doesn't return the same
thing if the result is "empty".
Look at this example using the code and the XML file :
<?php
/* ...
... code to get a xpath ...
... */
$ret = xpath_eval_expression($xPath, "/some/thing | /other/thing");
var_dump($ret);
?>
If the xpath doesn't match anything :
- In PHP4, this code displays
bool(false)
- In PHP5 (with PECL domxml module) , this code displays
object(XPathObject)#25 (2) {
["type"]=>
int(1)
["nodeset"]=>
array(0) {
}
which is NOT false !!!