How to handle disabling of prepared statements
===

I have a database class which user can instantiate.

    class Foo extends PDO
    {
        public function __construct($dsn, $username, $password)
        {
            parent::__construct($dsn, $username, $password);
    
            $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        }
    }
    
    $dsn = 'mysql:host=127.0.0.1;dbname=dbdatabase;charset=utf8';
    $dbConnection = new Foo($dsn, 'root', 'password');

However I need to disable the emulation of prepared statements in the constructor when the driver used is `mysql`:

    $this->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);

For other drivers (that I know of) the emulation of prepared statements is disabled by default (like it should be). What would be the correct way to disable emulated prepared statements in my class.

- Always add the line to disable emulated prepared statements? Will this have any side effects?
- Do a `stripos($dsn, 'mysql:')` to find mysql in the dsn?
- By using `PDO::getAttribute('PDO::ATTR_DRIVER_NAME')`?