FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17635&edit=1

ID: 17635
Updated by: jon@php.net
Reported By: patrick dot tanz at gbg-ag dot com
Summary: PHP strict warnings for static methods Log::factory()
and Log::singleton()
-Status: Open
+Status: Duplicate
Type: Bug
Package: Log
Operating System: SuSE Linux 10.1
Package Version: 1.12.1
PHP Version: 5.2.12
-Assigned To:
+Assigned To: jon
Roadmap Versions:
New Comment:

-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: jon
Duplicate of #17509.


Previous Comments:
------------------------------------------------------------------------

[2010-07-27 14:29:13] patrick2901

Description:
------------
If you set error_reporting to strict (as it is default for our web
application for quality assurance reasons), you get error messages on
calling the static methods of class Log. Since PHP5, it is recommended
to use the available keywords like "public"/"protected"/"private" and
"static".

The fix for this bug is very simple and is already implemented on our
servers: Simply declare the methods "factory" and "singleton" as "public
static function" instead of only "function".

Test script:
---------------
error_reporting(E_ALL | E_STRICT);
$oLog = Log::factory(...);

Expected result:
----------------
no warnings / no errors

Actual result:
--------------
Error Message: "Strict Standards: Method "factory" should not be called
statically, using $this from incompatible context."

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 27, '10 at 4:17p
activeJul 27, '10 at 4:17p
posts1
users1
websitepear.php.net

1 user in discussion

Jon: 1 post

People

Translate

site design / logo © 2022 Grokbase