|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72196 Wrong documantation
Submitted: 2016-05-11 12:41 UTC Modified: 2016-05-11 13:38 UTC
From: k dot warnke at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 7.0.6 OS: Windows 7
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:
28 - 10 = ?
Subscribe to this entry?

 [2016-05-11 12:41 UTC] k dot warnke at gmail dot com
From manual page:
It looks like that inTransaction() is not a PDO class static method.
It I use it as proposed


I get this error:

Fatal error: Uncaught Error: Non-static method PDO::inTransaction() cannot be called statically 

If I change it to 

        $db = new PDO(DB_DSN, DB_USER, DB_PASS, DB_OPT);
        if ($db->inTransaction())

it works.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-11 13:38 UTC]
-Status: Open +Status: Not a bug
 [2016-05-11 13:38 UTC]
The documentation does not say it is static.

If you're looking at the Description, the "::" does not mean static. (It is not, in fact, a "static method call" operator in the first place.) That is the syntax used within the manual to show that inTransaction is a method of the PDO class. Consider that "PDO->inTransaction" would not be any better.

If it was static the description would say "static". See PDO::getAvailableDrivers() <> for an example of that.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Dec 03 01:01:23 2020 UTC