As contantes abaixo são definidas por esta extensão e somente estarão disponíveis quando a extensão foi compilada com o PHP ou carregada dinamicamente durante a execução.
PDO uses class constants since PHP 5.1. Prior releases use global constants in the form PDO_PARAM_BOOL.
Nota: The magic __set method is called if the property doesn't exist in the requested class
Exemplo #1 using PDO::ATTR_DRIVER_NAME
<?php
if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
echo "Running on mysql; doing something mysql specific here\n";
}
?>