note 104612 added to domxpath.evaluate

From: Date: Sun, 26 Jun 2011 04:56:45 +0000
Subject: note 104612 added to domxpath.evaluate
Groups: php.notes 
Request: Send a blank email to php-notes+get-180953@lists.php.net to get a copy of this message
Note that this method does not provide any means to distinguish between a successful result that returns FALSE and an error. For example, this will succeed and return FALSE: <?php $xpath->evaluate("1 = 0"); ?> One workaround when you know you are expecting a Boolean is to wrap the result with string(). e.g. <?php $xpath->evaluate("string(1 = 0)"); ?> This will return a string "false" on success, or the Boolean FALSE on error. ---- Server IP: 69.147.83.197 Probable Submitter: 70.252.10.38 ---- Manual Page -- http://www.php.net/manual/en/domxpath.evaluate.php Edit -- https://master.php.net/note/edit/104612 Del: integrated -- https://master.php.net/note/delete/104612/integrated Del: useless -- https://master.php.net/note/delete/104612/useless Del: bad code -- https://master.php.net/note/delete/104612/bad+code Del: spam -- https://master.php.net/note/delete/104612/spam Del: non-english -- https://master.php.net/note/delete/104612/non-english Del: in docs -- https://master.php.net/note/delete/104612/in+docs Del: other reasons-- https://master.php.net/note/delete/104612 Reject -- https://master.php.net/note/reject/104612 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180953) next »