Re: Function returning but continues execution

From: Date: Mon, 22 Jan 2007 17:45:23 +0000
Subject: Re: Function returning but continues execution
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-247558@lists.php.net to get a copy of this message
At the very bottom of your function place another return with a string like return 'FOUND THE END OF FUNCTION'; now, echo the return of the function and see if it really the return function that you think it is that is returning false, or you are just hitting the end of the function. Jim
Yeah I tried this - I have confirmed that the return is the one I think it is. However, it seems this is actually being caused by some weirdness with mod_rewrite. Basically, if I use the rewritten URL e.g. example.com/section/addfriend/will/ which rewrites to index.php?cmd=section/addfriend&username=will I get this bug. But if I access index.php?cmd=section/addfriend&username=will directly then it works fine. This is definitely not a bug in my code but something to do with PHP, Apache and/or mod_rewrite. Unless anyone can suggest otherwise, I think it's going to be far too complex to debug and produce a test case because of the complexity of the code and working out where the bug actually is in PHP, Apache or mod_rewrite. So I'm just going to work around it. David

« previous php.general (#247558) next »