note 77445 deleted from functions.returning-values by betz

From: Date: Wed, 14 Nov 2007 10:28:59 +0000
Subject: note 77445 deleted from functions.returning-values by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-132259@lists.php.net to get a copy of this message
Note Submitter: mmamedov ::> pub [at] turkmenweb d0t c0m ---- It took my some 30 minutes to figure out this strange thing that I happened to have, wasn't aware of this before. Posting here so that it might help for some of you as well.. Let say you have a function that returns a 0 or 1: function isValid(){ if(true) return 1; else return 0; } In your code you should call this as: if (someFunction == '0') { //mind quotes! // do something } it is very strange, but it didn't work for me when I tried ==0, and even when I tried if (!someFunction) .... I even tried to have my function return booleans as in 'return false' and return 'true'. I have PHP 4.4.6, 1.3.37 (Unix) PS: don't know whether it is a bug, or normal behavior :/ Peace. @mm

« previous php.notes (#132259) next »