Bug #18483 Updated: include fails in a switch context

From: Date: Tue, 23 Jul 2002 12:47:11 +0000
Subject: Bug #18483 Updated: include fails in a switch context
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14873@lists.php.net to get a copy of this message
ID: 18483 Updated by: nielsene@mit.edu Reported By: nielsene@mit.edu Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.1.2 New Comment: I'm sorry, I don't see how this is not a bug. I checked over the documentation included user comments before submitting this. No where does it mention that includes are not valid within a switch context. It does mention the need for the braces within a conditional context, which led me to beleive it should work within a switch. If the parser is behaving correctly, then this might be a documentation oversight. Previous Comments: ------------------------------------------------------------------------ [2002-07-23 01:37:06] derick@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ [2002-07-22 22:46:07] nielsene@mit.edu Using an include (or require) from within a switch statement, generates a parse error (expecting T_CASE or T_DEFAULT). --test.php <?php $foo=1; switch($foo) { include "bar.inc"; } exit; ?> --bar.inc <?php case 1: echo "1"; break; case 2: echo "2"; break; default : echo "3"; break; ?> -- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18483&edit=1

« previous php.bugs (#14873) next »