`demo` should be `Demo` and in new classes you might want to use namespaces instead of underscores in your class names. See [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)
As non of your `$args` is optional and there are only 5 I would recommend the use real method parameters instead of this array. Otherwise some validation and documentation of this array is missing.
Furthermore you could refactor your ifs to real guard conditions and skip the else branch. This makes the code more readable and you get rid of a indentation level. There are also no braces on one-line-ifs.
**Edit Sample for guard conditions**
class PDOConnection_Factory {
private function __construct() {}
public static function build($args) {
if (!isset($args)) return NULL;
$statement = ...
try {
$dbh = ...
return $dbh;
} catch (PDOException $e) {
//as Cygal stated this is not very nice
echo 'Error: ', $e->getMessage(), "\n";
return NULL;
}
}
}
**Edit 2 Handle many and optinal method/constructor parameter**
Give me a second...