Re: Re: [PEPr] Comment on XML::XML_XUL
| From: | Alan Knowles | Date: | Mon, 23 Feb 2004 09:40:48 +0000 |
| Subject: | Re: Re: [PEPr] Comment on XML::XML_XUL | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-25796@lists.php.net to get a copy of this message | ||
null in PHP is not really a very reliable value to test against.. -
if ($sometest) {
$xx = $xul->getElementbyId('somename');
}
if (is_null($xx)) {
echo "it's true";
}
undefined vars evaluate to null... using false is a slightly less error prone test..
Regards
Alan
Stefan Neufeind wrote:
On 23 Feb 2004 at 9:21, Stephan Schmidt wrote:-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comYes, returning null might also be a good choice for "not found". Agreed imho, when it comes to objects. Regards, StefangetElementByName() should not return a pear error .. it's too fat and slow.. for something like this. - just use false... and === tests.Then I'd prefer a null value...