ID: 38003 Updated by: [EMAIL PROTECTED] Reported By: pmiroslawski at gmail dot com -Status: Assigned +Status: Closed Bug Type: Class/Object related Operating System: Linux DEBIAN 3.1 PHP Version: 5.1.4 Assigned To: tony2001 New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [2006-07-04 12:22:16] pmiroslawski at gmail dot com Description: ------------ Problem with create of object class then contruct is private. I use singleton pattern and inheritance and I can create object (no error and warning) if i didn't use inheritance was error (this behavior is ok). Reproduce code: --------------- <?php class DB extends mysqli{ private static $instance; private function __construct($hostname=DB_HOST, $username=DB_USER, $password=DB_PASSWORD, $database=DB_DATABASE){ //parent::__construct($hostname, $username, $password, $database); } public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new DB(); } return self::$instance; } } $DB = new DB(); ?> Expected result: ---------------- Fatal error: Call to private DB::__construct() Actual result: -------------- Everything is ok. No error! No warning! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38003&edit=1
