Re: coding standards - draft

From: Date: Fri, 11 Jan 2002 00:19:23 +0000
Subject: Re: coding standards - draft
References: 1 2 3 4 5 6 7 8  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969341065@lists.php.net to get a copy of this message
| > | > $conn = mysql_connect(...) or user_error("Cannot connect", | E_USER_ERROR); | > | > lacks flexibility, not in error_handling but the in the or construct. | > | Philip | > | > Olson dropped a note about this in a recent mail. | > | > I'll check it, but you can write still: | > | > $connect = mysql_connect(...); | > if ($connect === FALSE) { | > trigger_error(...); | > } | | As resource ids are defined to be always true, after | casting to boolean (not depending on whether they | are implemented with integers or not), using "or" | is safe. And it is short. Personally, I use the or syntax, too. I only want to step over this little thing: "or" or not "or".

« previous php.doc (#969341065) next »