RE: [PHP] Function Reqest/Question

From: Date: Tue, 03 Jul 2001 06:56:19 +0000
Subject: RE: [PHP] Function Reqest/Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55938@lists.php.net to get a copy of this message
Personally, I kind of like: switch(1){ default: // BREAK BLOCK START blah blah blah... // Want to get out of here... break; } // BREAK BLOCK END It's a little more cumbersome than the while construct, but it is absolutely guaranteed to only go through once, whilst the "while" version you HAVE to rememeber to put in the closing "break", otherwise you risk an infinite loop. At 16:25 2/07/2001 -0400, Matthew Loff wrote:
The best way I've seen this done is: <?php while(0)
( ... and it should be "while(1)" )
{
        blah blah blah...
        // Want to get out of here...
        break;
} ?> But putting it within while(0), you can simply break; from it... There may be better ways... Any other suggestions?
------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: bwhite@steptwo.com.au

« previous php.general (#55938) next »