dynamic case statements?
| From: | Tom Cruickshank | Date: | Fri, 18 Aug 2006 16:58:08 +0000 |
| Subject: | dynamic case statements? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240857@lists.php.net to get a copy of this message | ||
Hello,
Would anyone know if it's possible to have dynamic case statements?
For example.
Theform = new form();
$temp = $_POST['var1'];
switch ($temp) {
case "status":
$theform->status();
break;
case $temp:
$theform->form($temp);
break;
}
This keeps giving me Call to undefined method form::form() in
/usr/local/www/data-dist/form.php on line 38
Line 38 is right after case $temp:
If I have case "temp": error goes away, so I get the feeling case doesn't
like the variable $temp.
Any help would be appreciated. Thanks!
Tom
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.2/422 - Release Date: 8/17/2006