Bug #18398 [Ver->Csd]: non-static functions called statically

From: Date: Thu, 22 Mar 2012 15:32:09 +0000
Subject: Bug #18398 [Ver->Csd]: non-static functions called statically
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-8421@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=18398&edit=1 ID: 18398 Updated by: danielc@analysisandsolutions.com Reported By: chris dot johnk at gmail dot com Summary: non-static functions called statically -Status: Verified +Status: Closed Type: Bug Package: MDB2 Operating System: OS X Package Version: 2.5.0b3 PHP Version: 5.3.5 -Assigned To: +Assigned To: danielc -Roadmap Versions: 2.6 +Roadmap Versions: New Comment: -Status: Verified +Status: Closed -Assigned To: +Assigned To: danielc -Roadmap Versions: 2.6 +Roadmap Versions: Fixed in SVN. Will try to get a new beta released soon. Previous Comments: ------------------------------------------------------------------------ [2012-01-31 02:57:47] danielc Note for MDB2 developers: a test has been added to BugsTest.php and marked as skipped. ------------------------------------------------------------------------ [2012-01-31 02:41:27] danielc -Status: Open +Status: Verified -Roadmap Versions: +Roadmap Versions: 2.6 Ladies and Gentlemen: PEAR and MDB2 are not E_STRICT compliant. Marking MDB2::raiseError() static just moves the error up the chain to PEAR::raiseError() not being static. Changing this situation will take some thought. The reason you're seeing this is you are using a custom error handler. Error handlers ignore what's set in error_reporting. If you want to see strict errors, adjust your error handler to return without doing anything if the error level is E_STRICT. ------------------------------------------------------------------------ [2012-01-30 23:57:31] drizzle Seriously, I think this package needs a new maintainer. One of the many reasons why PHP is the joke of the programming world. Something as simple as a database abstraction layer goes dead for years... ------------------------------------------------------------------------ [2012-01-19 09:08:56] alec Why this is still not fixed? I think the fix is as simple as adding "static" keyword to the method definition. ------------------------------------------------------------------------ [2011-03-25 01:03:44] cdjohnk Description: ------------ I'm getting the following error in php 5.3: DATE: 3/24/11 16:31:32 ERROR NUMBER: 2048 ERROR: Non-static method MDB2::raiseError() should not be called statically FILE: /usr/lib/php/MDB2.php:340 The DSN in the attached is purposely bogus to try to trigger raiseError(). raiseError() is not getting called because it's not declared static. Adding ~E_STRICT to error_reporting in php.ini did not help. Test script: --------------- require_once("MDB2.php"); $dsn = array( 'phptype' => 'x', 'hostspec' => 'x', 'database' => 'x', 'username' => 'x', 'password' => 'x' ); $db = new MDB2(); $dbh = $db->connect($dsn); Expected result: ---------------- The appropriate error message generated by raiseError in response to the bogus DSN. Actual result: -------------- DATE: 3/24/11 16:31:32 ERROR NUMBER: 2048 ERROR: Non-static method MDB2::raiseError() should not be called statically FILE: /usr/lib/php/MDB2.php:340 ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=18398&edit=1

« previous php.pear.bugs (#8421) next »