Bug #53082 [Opn->Ver]: unexp. warning with abstract static methods used inside namespace/required file

From: Date: Sat, 16 Oct 2010 14:34:33 +0000
Subject: Bug #53082 [Opn->Ver]: unexp. warning with abstract static methods used inside namespace/required file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-155245@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53082&edit=1

 ID:                 53082
 Updated by:         felipe@php.net
 Reported by:        giorgio dot liscio at email dot it
 Summary:            unexp. warning with abstract static methods used
                     inside namespace/required file
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            Class/Object related
 PHP Version:        5.3.3
 Block user comment: N

 New Comment:

The namespace is not a factor, but the require yes.

Internally the php_error_cb() function is called for both cases, but
just displays when the code is in another file because
EG(error_reporting) is set to 'E_ALL | E_STRICT', when it's in the same
file, EG(error_reporting) is 22519.


Previous Comments:
------------------------------------------------------------------------
[2010-10-16 09:36:52] giorgio dot liscio at email dot it

Description:
------------
without namespace works perfectly:


<?php
// index.php
ini_set("display_errors", true);
ini_set("error_reporting", E_ALL | E_STRICT);
abstract class AbstractFileSystemItem
{
	abstract static function ensurePathIsValid($fullPath);
}
class Dir extends AbstractFileSystemItem
{
	static function ensurePathIsValid($fullPath){}
}
?>

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

with namespace and require: (test the two files)
gives unexpected warning 
Static function AbstractFileSystemItem::ensurePathIsValid() should not
be abstract

<?php
// index.php (run this)
ini_set("display_errors", true);
ini_set("error_reporting", E_ALL | E_STRICT);
require("FSNuovo/Directory.php");
?>


<?php
// FSNuovo/Directory.php
namespace FSNuovo;
abstract class AbstractFileSystemItem
{
	abstract static function ensurePathIsValid($fullPath);
}
class Dir extends AbstractFileSystemItem
{
	static function ensurePathIsValid($fullPath){}
}
?>

original discussion: http://bugs.php.net/bug.php?id=53081



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



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53082&edit=1


Thread (6 messages)

« previous php.bugs (#155245) next »