note 88203 added to function.xpath-eval-expression
| From: | trotters213 at msn dot com | Date: | Thu, 15 Jan 2009 10:42:34 +0000 |
| Subject: | note 88203 added to function.xpath-eval-expression | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149248@lists.php.net to get a copy of this message | ||
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 !!!
----
Server IP: 194.153.94.10
Probable Submitter: 82.236.237.85
----
Manual Page -- http://www.php.net/manual/en/function.xpath-eval-expression.php
Edit -- https://master.php.net/note/edit/88203
Del: integrated -- https://master.php.net/note/delete/88203/integrated
Del: useless -- https://master.php.net/note/delete/88203/useless
Del: bad code -- https://master.php.net/note/delete/88203/bad+code
Del: spam -- https://master.php.net/note/delete/88203/spam
Del: non-english -- https://master.php.net/note/delete/88203/non-english
Del: in docs -- https://master.php.net/note/delete/88203/in+docs
Del: other reasons-- https://master.php.net/note/delete/88203
Reject -- https://master.php.net/note/reject/88203
Search -- https://master.php.net/manage/user-notes.php