php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47769 Strange extends PDO
Submitted: 2009-03-25 06:43 UTC Modified: 2009-03-26 12:54 UTC
From: admin at d9tx dot com Assigned: felipe (profile)
Status: Closed Package: PDO related
PHP Version: 5.3.0RC1 OS: xp sp3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: admin at d9tx dot com
New email:
PHP Version: OS:

 

 [2009-03-25 06:43 UTC] admin at d9tx dot com
Description:
------------
if extends pdo, then visibility keyword work failure.

Reproduce code:
---------------
class test extends PDO
{
    private function isPrivate()
    {
        echo 'this is a private method.';
    }
}

$test = new test('sqlite:./test/mydb.sq3');
$test->isPrivate();
// bad output: this is a private method.

Expected result:
----------------
class test extends PDO
{
    private function isPrivate()
    {
        echo 'this is a private method.';
    }
}

$test = new test('sqlite:./test/mydb.sq3');
$test->isPrivate();
// Expected output: Fatal error: Call to private method test::isPrivate() from


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-26 12:54 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in 5.3CVS and HEAD.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 30 10:01:30 2025 UTC