returning early from a function.

From: Date: Mon, 29 Dec 2003 17:07:24 +0000
Subject: returning early from a function.
Groups: php.general 
Request: Send a blank email to php-general+get-173555@lists.php.net to get a copy of this message
I have a function that does several tests and if any are true it needs to return false but I get an error about unexpected return for all returns except for the last one. function test($s) { if($s = 'this') return false; if($s = 'that') return false; return true; } any ideas on how to make this work or why it doesn't work? Chris W

« previous php.general (#173555) next »