On Fri, May 20, 2011 at 12:55, Marc Guay <[email protected]> wrote:
> I imagine this one's been done before, but maybe not in the same way....
I believe it was, but not quite the same, you're right.
"If at first you don't succeed, try, try again."
Nice one, Marc.
> <?php
>
> $result = succeed();
>
> while (!$result){
> try{
> $result = succeed();
>
> }
> catch (Exception $e){
> echo $e;
> }
> }
> echo "hell yeah";
>
> function succeed(){
> $a = rand(1,2);
>
> switch($a){
> case 1:
> trigger_error('fml');
> break;
> case 2:
> return TRUE;
> break;
> }
> }
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php