RE: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /pear DB.php /pear/DB common.phpmysql.php

From: Date: Mon, 04 Dec 2000 19:05:49 +0000
Subject: RE: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /pear DB.php /pear/DB common.phpmysql.php
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-40024@lists.php.net to get a copy of this message
If you read the horde coding standards the snippet in question would read (no tabs, 4 spaces and only the function definition is "one true brace") function connect(&$dsn, $persistent = false) { if (is_array($dsn)) { $dsninfo = &$dsn; } else { $dsninfo = DB::parseDSN($dsn); } if (!$dsninfo || !$dsninfo['phptype']) { return $this->raiseError(); } } I for one find this very readable. There is really no point to continue bickering about it, unless that bickering is the process of drafting the standards. Chris Newbill -----Original Message----- From: Sebastian Bergmann [mailto:sb@sebastian-bergmann.de] Agreed, but are you really telling me that function connect(&$dsn, $persistent = false) { if (is_array($dsn)) { $dsninfo = &$dsn; } else { $dsninfo = DB::parseDSN($dsn); } if (!$dsninfo || !$dsninfo['phptype']) { return $this->raiseError(); } is more readable as function connect( &$dsn, $persistent = false ) { if( is_array( $dsn ) ) { $dsninfo = &$dsn; } else { $dsninfo = DB::parseDSN( $dsn ); } if( !$dsninfo || !$dsninfo[ 'phptype' ] ) { return $this->raiseError(); } ? -- <? print implode( "", array_reverse( preg_split( "//", "dlrow laer " . "eht ot emoclew" ) ) ); /* visit http://www.sebastian-bergmann.de/ */ ?> -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#40024) next »