cvs: ZendEngine2(PHP_5_3) / zend_compile.c /tests 022.phpt
[email protected] ("Johannes Schl??ter")
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsjohannes1204379612@cvsserver> |
johannes Sat Mar 1 13:53:32 2008 UTC
Added files: (Branch: PHP_5_3)
/ZendEngine2/tests 022.phpt
Modified files:
/ZendEngine2 zend_compile.c
Log:
MFH: Allow implementation of abstract methods with optional parameters (Christian
Schneider)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.41.2.44&r2=1.647.2.27.2.41.2.45&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.44 ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.45
--- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.44 Sat Feb 23 17:06:19 2008
+++ ZendEngine2/zend_compile.c Sat Mar 1 13:53:32 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.44 2008/02/23 17:06:19 helly Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.45 2008/03/01 13:53:32 johannes Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -2283,7 +2283,7 @@
}
/* check number of arguments */
- if (proto->common.required_num_args != fe->common.required_num_args
+ if (proto->common.required_num_args < fe->common.required_num_args
|| proto->common.num_args > fe->common.num_args) {
return 0;
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/022.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/022.phpt
+++ ZendEngine2/tests/022.phpt
--TEST--
Implementating abstracting methods and optional parameters
--FILE--
<?php
abstract class Base
{
abstract function someMethod($param);
}
class Ext extends Base
{
function someMethod($param = "default")
{
echo $param, "\n";
}
}
$a = new Ext();
$a->someMethod("foo");
$a->someMethod();
--EXPECT--
foo
default