Bug #73865 [Opn->Fbk]: extending PDO conflict with persistent connections

From: Date: Wed, 11 Jan 2017 04:57:54 +0000
Subject: Bug #73865 [Opn->Fbk]: extending PDO conflict with persistent connections
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206487@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73865&edit=1 ID: 73865 Updated by: krakjoe@php.net Reported by: gpkappos at ucy dot ac dot cy Summary: extending PDO conflict with persistent connections -Status: Open +Status: Feedback Type: Bug Package: PDO OCI Operating System: Windows 10 PHP Version: 5.6.29 Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2017-01-05 06:22:16] gpkappos at ucy dot ac dot cy Description: ------------ When extending PDO, if you use persistent connections you can only create instances of the first object that uses the connection. In the example below the constructor for B returns an instance of A Test script: --------------- class A extends \PDO { public function __construct() { parent::__construct('oci:dbname=//dbserver.example.org:1521/dbserver.example.org;charset=AL32UTF8', 'test', 'testpw', [PDO::ATTR_PERSISTENT => true]); } } class B extends \PDO { public function __construct() { parent::__construct('oci:dbname=//dbserver.example.org:1521/dbserver.example.org;charset=AL32UTF8', 'test', 'testpw', [PDO::ATTR_PERSISTENT => true]); } } $a = new A(); var_dump($a); $b = new B(); var_dump($b); Expected result: ---------------- object(A)[1] object(B)[2] Actual result: -------------- object(A)[1] object(A)[2] ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73865&edit=1

« previous php.bugs (#206487) next »