Doc #72196 [Opn->Nab]: Wrong documantation

From: Date: Wed, 11 May 2016 13:38:58 +0000
Subject: Doc #72196 [Opn->Nab]: Wrong documantation
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13449@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72196&edit=1 ID: 72196 Updated by: requinix@php.net Reported by: k dot warnke at gmail dot com Summary: Wrong documantation -Status: Open +Status: Not a bug Type: Documentation Problem Package: Documentation problem Operating System: Windows 7 PHP Version: 7.0.6 Block user comment: N Private report: N New Comment: 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() <http://php.net/manual/en/pdo.getavailabledrivers.php> for an example of that. Previous Comments: ------------------------------------------------------------------------ [2016-05-11 12:41:06] k dot warnke at gmail dot com Description: ------------ --- From manual page: http://www.php.net/pdo.intransaction --- It looks like that inTransaction() is not a PDO class static method. It I use it as proposed POD::inTransaction() 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()) { $db->rollBack(); } it works. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72196&edit=1

« previous php.doc.bugs (#13449) next »