Re: coding standards - draft

From: Date: Thu, 10 Jan 2002 20:29:42 +0000
Subject: Re: coding standards - draft
References: 1 2 3 4 5 6 7  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969341060@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. Goba

« previous php.doc (#969341060) next »