Derick Rethans wrote:
Sure, but then that code won't run on older versions of PHP (5.1 f.e.) anymore, so it is not a good solution.

The same was true for PPP.
But like you I prefer the E_STRICT version without modifying the language though. But I'm sharing Lukas' concern about the definition of E_STRICT: Is it to be changed to E_ERROR at some point? Otherwise E_NOTICE would be more appropriate IMHO.

Whatever solution is implemented I propose to relax the test to not test static functions (e.g. useful for factory methods) and to allow adding default values to functions (the object of the inherited class still accepts the same parameters as the base class). A patch is attached.

- Chris

Index: Zend/zend_compile.c
===================================================================
RCS file: /repository/ZendEngine2/zend_compile.c,v
retrieving revision 1.721
diff -u -r1.721 zend_compile.c
--- Zend/zend_compile.c 25 Jul 2006 00:01:40 -0000      1.721
+++ Zend/zend_compile.c 3 Aug 2006 09:26:45 -0000
@@ -2054,13 +2054,12 @@
        }
 
        /* Checks for constructors only if they are declared in an interface */
-       if ((fe->common.fn_flags & ZEND_ACC_CTOR) && 
!(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) {
+       if ((fe->common.fn_flags & (ZEND_ACC_CTOR | ZEND_ACC_STATIC)) && 
!(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) {
                return 1;
        }
 
        /* check number of arguments */
-       if (proto->common.required_num_args != fe->common.required_num_args
-               || proto->common.num_args > fe->common.num_args) {
+       if (proto->common.num_args > fe->common.num_args) {
                return 0;
        }
 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to