|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35452 PDO Constants are not defined
Submitted: 2005-11-28 16:44 UTC Modified: 2005-11-28 17:16 UTC
From: kang at respice dot de Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.1.0 OS: Win32 + Apache 2.0.55
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
3 + 27 = ?
Subscribe to this entry?

 [2005-11-28 16:44 UTC] kang at respice dot de
The PDO constants are not defined.

Reproduce code:
<?php print_r(get_defined_constants()); ?>
$DB = new PDO($dsn, $u, $p);

Expected result:
PDO_* constants to be defined.
Connection status attribute.

Actual result:
Constants are not defined.
Error: type long expected, string provided.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-28 16:48 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Read release/upgrading notes.
 [2005-11-28 17:04 UTC] kang at respice dot de
Maybe I am a little slow here ;)
I activated the extensions (php_pdo.dll and php_pdo_mysql.dll) in the php.ini. The instantiation of the PDO base class is successfull.
If the extension is loaded, the constants should be defined, isn't it?
 [2005-11-28 17:16 UTC]
Did you read upgrade notes?
Ok, I can paste it here for you if don't want to do it:
"9b. Class constants in new PHP 5.1 extensions

The Zend Engine 2.1 API allows extension developers to declare class constants
in object oriented extensions. New extensions written for PHP 5.1, including SPL,
PDO, ext/XMLReader and ext/date, have their constants in the format


rather than in the C format

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jan 17 19:01:22 2021 UTC