On Tue, 2006-03-07 at 12:58, John Coggeshall wrote: > if($choice == 1) { > goto bad; > } else if ($choice == 2) { > goto good; > } else if ($choice == 3) { > goto bad; > } else if ($choice == 4) { > goto good; > } > > good: > $vote++; > bad: > return;
I don't remember, but I think Sarah Golemon allowed for it in one of her patches way back: <?php $map = array ( 1 => 'bad', 2 => 'good', 3 => 'bad', 4 => 'acceptable', ); goto $map[$choice]; good: vote += .5; acceptable: vote += .5; bad: return; ?> For the record, I wouldn't normally fall through like that, but we're just having fun :B Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php