#43703 [Asn]: Signature compatibility check broken for namespaces
| From: | sebastian@php.net | Date: | Sat, 05 Jan 2008 10:07:40 +0000 |
| Subject: | #43703 [Asn]: Signature compatibility check broken for namespaces | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121056@lists.php.net to get a copy of this message | ||
ID: 43703
User updated by: sebastian@php.net
Reported By: sebastian@php.net
Status: Assigned
Bug Type: Scripting Engine problem
Operating System: Irrelevant
PHP Version: 5.3CVS-2007-12-29 (CVS)
Assigned To: dmitry
New Comment:
I think the issue lies in the following code in zend_compile.c:
if (fe->common.type == ZEND_USER_FUNCTION &&
strchr(proto->common.arg_info[i].class_name, ':') == NULL &&
(colon = zend_memrchr(fe->common.arg_info[i].class_name, ':',
fe->common.arg_info[i].class_name_len)) != NULL &&
strcmp(colon+1, proto->common.arg_info[i].class_name) == 0) {
efree((char*)fe->common.arg_info[i].class_name);
fe->common.arg_info[i].class_name =
estrndup(proto->common.arg_info[i].class_name,
proto->common.arg_info[i].class_name_len);
fe->common.arg_info[i].class_name_len =
proto->common.arg_info[i].class_name_len;
} else {
return 0;
}
Previous Comments:
------------------------------------------------------------------------
[2007-12-29 10:52:59] sebastian@php.net
Description:
------------
When a namespaced class extends an namespaced abstract class, the
signature compatiblity check breaks.
Reproduce code:
---------------
test.php
<?php
require 'joinpoint.php';
require 'pointcut.php';
require 'read.php';
joinpoint.php
<?php
namespace GAP;
class JoinPoint
{
}
pointcut.php
<?php
namespace GAP;
abstract class Pointcut
{
abstract public function evaluate(JoinPoint $joinPoint);
}
read.php
<?php
namespace GAP::Pointcut::Attribute;
use GAP::Joinpoint;
use GAP::Pointcut;
class Read extends Pointcut
{
public function evaluate(JoinPoint $joinPoint)
{
}
}
Expected result:
----------------
No syntax error.
Actual result:
--------------
Fatal error: Declaration of GAP::Pointcut::Attribute::Read::evaluate()
must be compatible with that of GAP::Pointcut::evaluate() in
/home/sb/read.php on line 12
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43703&edit=1