|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-10-13 07:25 UTC] jakespotgieter at hotmail dot com
Description:
------------
When there are multiple cases within a switch block, if you try to use the header function, more specifically header("location:$url") it doesn't work. When I ran the same code under 4.3.3 it worked.
Reproduce code:
---------------
SWITCH ($_GET['method']){
CASE 'Foo':
//do something
BREAK;
CASE 'Bar':
if($i == true){
header("location:?method=Foo")
}else{
//do something else
}
BREAK;
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 11:00:02 2025 UTC |
Sorry, I wrote this code quickly, trust me its got nothing to do with a parse error. It doesnt work on the Zend engine 2. I ported it back to 4.3, and it worked. I didnt change anything in the code. SWITCH ($_GET['method']){ CASE 'Foo': //do something BREAK; CASE 'Bar': if($i == true){ header("location:?method=Foo"); }else{ //do something else } BREAK; }Trust me, there were no syntax errors. I just typed a quick example to explain what I ment. @sniper@php.net - I even tried - header("location:http://www.google.com"); and nothing happened. It seems the bug happens when the cases in the switch statement have quite a big chunck on code in it. Just something to look into!