]> granicus.if.org Git - php/commitdiff
Improve the warning message of incompatible arguments. (#55719)
authorXinchen Hui <laruence@php.net>
Fri, 23 Sep 2011 15:08:11 +0000 (15:08 +0000)
committerXinchen Hui <laruence@php.net>
Fri, 23 Sep 2011 15:08:11 +0000 (15:08 +0000)
And fix tests related.

31 files changed:
Zend/tests/argument_restriction_001.phpt [new file with mode: 0644]
Zend/tests/argument_restriction_002.phpt [new file with mode: 0644]
Zend/tests/argument_restriction_003.phpt [new file with mode: 0644]
Zend/tests/argument_restriction_004.phpt [new file with mode: 0644]
Zend/tests/argument_restriction_005.phpt [new file with mode: 0644]
Zend/tests/bug47981.phpt
Zend/tests/bug51421.phpt
Zend/tests/objects_002.phpt
Zend/tests/objects_003.phpt
Zend/tests/objects_004.phpt
Zend/tests/objects_005.phpt
Zend/tests/objects_006.phpt
Zend/tests/objects_007.phpt
Zend/tests/objects_008.phpt
Zend/tests/objects_009.phpt
Zend/tests/traits/inheritance003.phpt
Zend/zend_compile.c
ext/standard/tests/filters/php_user_filter_01.phpt
ext/standard/tests/filters/php_user_filter_02.phpt
ext/standard/tests/filters/php_user_filter_03.phpt
tests/classes/ctor_in_interface_01.phpt
tests/classes/ctor_in_interface_03.phpt
tests/classes/ctor_in_interface_04.phpt
tests/classes/inheritance_003.phpt
tests/classes/inheritance_004.phpt
tests/classes/method_override_optional_arg_001.phpt
tests/classes/method_override_optional_arg_002.phpt
tests/classes/type_hinting_005a.phpt
tests/classes/type_hinting_005b.phpt
tests/classes/type_hinting_005c.phpt
tests/classes/type_hinting_005d.phpt

diff --git a/Zend/tests/argument_restriction_001.phpt b/Zend/tests/argument_restriction_001.phpt
new file mode 100644 (file)
index 0000000..e62ad30
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Bug #55719 (Argument restriction should come with a more specific error message)
+--FILE--
+<?php
+Class Base {
+       public function &test($foo, array $bar, $option = NULL, $extra = "lllllllllllllllllllllllllllllllllllllllllllllllllll") {
+       }       
+}
+
+class Sub extends Base {
+       public function &test() {
+       }       
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of Sub::test() should be compatible with & Base::test($foo, array $bar, $option = NULL, $extra = 'llllllllll...') in %sargument_restriction_001.php on line %d 
diff --git a/Zend/tests/argument_restriction_002.phpt b/Zend/tests/argument_restriction_002.phpt
new file mode 100644 (file)
index 0000000..c6a472e
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Bug #55719 (Argument restriction should come with a more specific error message)
+--FILE--
+<?php
+Abstract Class Base {
+       public function test($foo, array &$bar, $option = NULL, $extra = 3.141592653589793238462643383279502884197169399375105  ) {
+       }       
+}
+
+class Sub extends Base {
+       public function test($foo, array &$bar) {
+       }       
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of Sub::test() should be compatible with Base::test($foo, array &$bar, $option = NULL, $extra = 3.1415926535898) in %sargument_restriction_002.php on line %d
diff --git a/Zend/tests/argument_restriction_003.phpt b/Zend/tests/argument_restriction_003.phpt
new file mode 100644 (file)
index 0000000..393581f
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Bug #55719 (Argument restriction should come with a more specific error message)
+--FILE--
+<?php
+class Foo {
+}
+
+Abstract Class Base {
+       public function test(Foo $foo, array $bar, $option = NULL, $extra = "lllllllllllllllllllllllllllllllllllllllllllllllllll") {
+       }       
+}
+
+class Sub extends Base {
+       public function test() {
+       }       
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of Sub::test() should be compatible with Base::test(Foo $foo, array $bar, $option = NULL, $extra = 'llllllllll...') in %sargument_restriction_003.php on line %d
diff --git a/Zend/tests/argument_restriction_004.phpt b/Zend/tests/argument_restriction_004.phpt
new file mode 100644 (file)
index 0000000..599b3e1
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+Bug #55719 (Argument restriction should come with a more specific error message)
+--FILE--
+<?php
+class Foo {
+}
+
+Abstract Class Base {
+       abstract public function test(Foo $foo, array $bar, $option = NULL, $extra = 16777215) ;
+}
+
+class Sub extends Base {
+       public function test(Foo $foo, array $bar, $option = NULL, $extra = 0xffffff ) {
+       }       
+}
+?>
+--EXPECTF--
diff --git a/Zend/tests/argument_restriction_005.phpt b/Zend/tests/argument_restriction_005.phpt
new file mode 100644 (file)
index 0000000..2826fe6
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+Bug #55719 (Argument restriction should come with a more specific error message)
+--FILE--
+<?php
+class Sub implements ArrayAccess {
+       public function offsetSet() {
+       }       
+}
+?>
+--EXPECTF--
+Fatal error: Declaration of Sub::offsetSet() must be compatible with ArrayAccess::offsetSet($offset, $value) in %sargument_restriction_005.php on line %d
index 2d68d3706fe96596577bbf0c7a89394f237ab451..c16ae0ffc811d27392f8bc82084b2b1c74070cfd 100644 (file)
@@ -14,6 +14,6 @@ class b implements a { function f($a=1) {}}
 class c extends b {function f() {}}
 ?>
 --EXPECTF--
-string(62) "Declaration of c::f() should be compatible with that of b::f()"
+string(60) "Declaration of c::f() should be compatible with b::f($a = 1)"
 
 
index 825012a2890de44a425aeda064bdb4d54899fe67..bc1758c300802fe3877266b2869b83904c94f79c 100644 (file)
@@ -15,4 +15,4 @@ class Test extends TestInterface {
 
 ?>
 --EXPECTF--
-Fatal error: Declaration of Test::__construct() must be compatible with that of TestInterface::__construct() in %s on line %d
+Fatal error: Declaration of Test::__construct() must be compatible with TestInterface::__construct(ExampleClass $var) in %s on line %d
index 87ba0fdc3bc4c685d77eec8e7c0bc43723815c6c..e2db140b181cd4b390e735b0b17506c15d912895 100644 (file)
@@ -20,5 +20,5 @@ class test3 extends test {
 echo "Done\n";
 ?>
 --EXPECTF--    
-Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Strict Standards: Declaration of test3::foo() should be compatible with test::foo() in %s on line %d
 Done
index 1c254290f72e98304c5c1b39917707bf1e1cdba2..7e0f08326781544c00219391f2fb679e0730ccf2 100644 (file)
@@ -20,5 +20,5 @@ class test3 extends test {
 echo "Done\n";
 ?>
 --EXPECTF--    
-Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Strict Standards: Declaration of test3::foo() should be compatible with test::foo($arg) in %s on line %d
 Done
index 35ab4775b157b3a415ed40b267ace6923a3aa583..eb04124474f6a78182f777094b0f11013361759d 100644 (file)
@@ -20,5 +20,5 @@ class test3 extends test {
 echo "Done\n";
 ?>
 --EXPECTF--    
-Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Strict Standards: Declaration of test3::foo() should be compatible with test::foo($arg) in %s on line %d
 Done
index d583c9be90d742f0e2f894ae1373979ebb4c7bd0..908e797243b3af34066a8f1d388fcb83d50e0948 100644 (file)
@@ -20,5 +20,5 @@ class test3 extends test {
 echo "Done\n";
 ?>
 --EXPECTF--    
-Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Strict Standards: Declaration of test3::foo() should be compatible with & test::foo() in %s on line %d
 Done
index fb2e28b3af674ad0d7a0f6323d05b1b7fa51896a..f84a3053e991d770e5f47b89b863a24c3a6a2400 100644 (file)
@@ -20,5 +20,5 @@ class test3 extends test {
 echo "Done\n";
 ?>
 --EXPECTF--    
-Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Strict Standards: Declaration of test3::foo() should be compatible with test::foo($arg, $arg2 = NULL) in %s on line %d
 Done
index 2fce04a17db3bb808e79914546093eea49675bcc..75e0817589edc9d02015b8df03404617db5b9a08 100644 (file)
@@ -20,5 +20,5 @@ class test3 extends test {
 echo "Done\n";
 ?>
 --EXPECTF--    
-Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Strict Standards: Declaration of test3::foo() should be compatible with test::foo($arg, &$arg2 = NULL) in %s on line %d
 Done
index b61d16786c03c834cbf6b29173f3a9a1b4e0497e..f6d5826eb89f7485226b084bea38dad6f25b05ed 100644 (file)
@@ -20,5 +20,5 @@ class test3 extends test {
 echo "Done\n";
 ?>
 --EXPECTF--    
-Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Strict Standards: Declaration of test3::foo() should be compatible with test::foo(Test $arg) in %s on line %d
 Done
index 5fad0046a883d9ce1966da0208159b9063f59c3e..04b1118e093d7a8215bf0f02b1041b6417a73e8b 100644 (file)
@@ -20,5 +20,5 @@ class test3 extends test {
 echo "Done\n";
 ?>
 --EXPECTF--    
-Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Strict Standards: Declaration of test3::foo() should be compatible with test::foo(Test $arg) in %s on line %d
 Done
index ba2e4da76da77d203141f8b6d6d310b0f5db5348..b457a73fea631d23bc6cbca0bb1508b18ca4f4d6 100644 (file)
@@ -35,4 +35,4 @@ $o->sayHello(array());
 --EXPECTF--    
 World!
 
-Fatal error: Declaration of MyHelloWorld::sayHello() must be compatible with that of Base::sayHello() in %s on line %d
+Fatal error: Declaration of MyHelloWorld::sayHello() must be compatible with Base::sayHello(array $a) in %s on line %d
index 13ee9b28d08bcc4f4b22d48ed0f398e15393ef69..83de4ea60d182d62b9419858bdd2db8678347464 100644 (file)
@@ -3010,7 +3010,169 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
 }
 /* }}} */
 
-static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC)
+#define REALLOC_BUF_IF_EXCEED(buf, offset, length, size) \
+       if (UNEXPECTED(offset - buf + size >= length)) {        \
+               length += size + 1;                             \
+               buf = erealloc(buf, length);            \
+       }
+
+static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{{ */ 
+{
+       char *offset, *buf;
+       zend_uint length = 1024;
+
+       offset = buf = (char *)emalloc(length * sizeof(char));
+       if (fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
+               *(offset++) = '&';
+               *(offset++) = ' ';
+       }
+
+       if (fptr->common.scope) {
+               memcpy(offset, fptr->common.scope->name, fptr->common.scope->name_length);
+               offset += fptr->common.scope->name_length;
+               *(offset++) = ':';
+               *(offset++) = ':';
+       }
+       
+       {
+               size_t name_len = strlen(fptr->common.function_name);
+               REALLOC_BUF_IF_EXCEED(buf, offset, length, name_len);
+               memcpy(offset, fptr->common.function_name, name_len);
+               offset += name_len;
+       }
+
+       *(offset++) = '(';
+       if (fptr->common.arg_info) {
+               zend_uint i, required;
+               zend_arg_info *arg_info = fptr->common.arg_info;
+
+               required = fptr->common.required_num_args;
+               for (i = 0; i < fptr->common.num_args;) {
+                       if (arg_info->class_name) {
+                               REALLOC_BUF_IF_EXCEED(buf, offset, length, arg_info->class_name_len);
+                               memcpy(offset, arg_info->class_name, arg_info->class_name_len);
+                               offset += arg_info->class_name_len;
+                               *(offset++) = ' ';
+                       } else if (arg_info->type_hint) {
+                               zend_uint type_name_len;
+                               char *type_name = zend_get_type_by_const(arg_info->type_hint);
+                               type_name_len = strlen(type_name);
+                               REALLOC_BUF_IF_EXCEED(buf, offset, length, type_name_len);
+                               memcpy(offset, type_name, type_name_len);
+                               offset += type_name_len;
+                               *(offset++) = ' ';
+                       }
+                               
+                       if (arg_info->pass_by_reference) {
+                               *(offset++) = '&';
+                       }
+                       *(offset++) = '$';
+
+                       if (arg_info->name) {
+                               REALLOC_BUF_IF_EXCEED(buf, offset, length, arg_info->name_len);
+                               memcpy(offset, arg_info->name, arg_info->name_len);
+                               offset += arg_info->name_len;
+                       } else {
+                               zend_uint idx = i;
+                               memcpy(offset, "param", 5);
+                               offset += 5;
+                               do {
+                                       *(offset++) = (char) (idx % 10) + '0';
+                                       idx /= 10;
+                               } while (idx > 0);
+                       }
+                       if (i >= required) {
+                               *(offset++) = ' ';
+                               *(offset++) = '=';
+                               *(offset++) = ' ';
+                               if (fptr->type == ZEND_USER_FUNCTION) {
+                                       zend_op *precv = NULL;
+                                       {
+                                               zend_uint idx  = i;
+                                               zend_op *op = ((zend_op_array *)fptr)->opcodes;
+                                               zend_op *end = op + ((zend_op_array *)fptr)->last;
+
+                                               ++idx;
+                                               while (op < end) {
+                                                       if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT)
+                                                                       && op->op1.num == (long)idx)
+                                                       {
+                                                               precv = op;
+                                                       }
+                                                       ++op;
+                                               }
+                                       }
+                                       if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) {
+                                               zval *zv, zv_copy;
+                                               int use_copy;
+                                               ALLOC_ZVAL(zv);
+                                               *zv = *precv->op2.zv;
+                                               zval_copy_ctor(zv);
+                                               INIT_PZVAL(zv);
+                                               zval_update_constant_ex(&zv, (void*)1, fptr->common.scope TSRMLS_CC);
+                                               if (Z_TYPE_P(zv) == IS_BOOL) {
+                                                       if (Z_LVAL_P(zv)) {
+                                                               memcpy(offset, "true", 4);
+                                                               offset += 4;
+                                                       } else {
+                                                               memcpy(offset, "false", 5);
+                                                               offset += 5;
+                                                       }
+                                               } else if (Z_TYPE_P(zv) == IS_NULL) {
+                                                       memcpy(offset, "NULL", 4);
+                                                       offset += 4;
+                                               } else if (Z_TYPE_P(zv) == IS_STRING) {
+                                                       *(offset++) = '\'';
+                                                       REALLOC_BUF_IF_EXCEED(buf, offset, length, MIN(Z_STRLEN_P(zv), 10));
+                                                       memcpy(offset, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 10));
+                                                       offset += MIN(Z_STRLEN_P(zv), 10);
+                                                       if (Z_STRLEN_P(zv) > 10) {
+                                                               *(offset++) = '.';
+                                                               *(offset++) = '.';
+                                                               *(offset++) = '.';
+                                                       }
+                                                       *(offset++) = '\'';
+                                               } else {
+                                                       zend_make_printable_zval(zv, &zv_copy, &use_copy);
+                                                       if (Z_TYPE_P(zv) == IS_STRING) {
+                                                               REALLOC_BUF_IF_EXCEED(buf, offset, length, MIN(Z_STRLEN_P(zv), Z_STRLEN_P(zv)));
+                                                               memcpy(offset, Z_STRVAL_P(zv), Z_STRLEN_P(zv));
+                                                               offset += Z_STRLEN_P(zv);
+                                                       } else if (Z_TYPE_P(zv) == IS_LONG) {
+                                                               REALLOC_BUF_IF_EXCEED(buf, offset, length, 21); 
+                                                               offset += zend_sprintf(offset, "%ld", Z_LVAL_P(zv));
+                                                       } else if (Z_TYPE_P(zv) == IS_DOUBLE) {
+                                                               REALLOC_BUF_IF_EXCEED(buf, offset, length, 21); 
+                                                               offset += zend_sprintf(offset, "%.*G", (int) EG(precision), Z_DVAL_P(zv));
+                                                       }
+                                                       if (use_copy) {
+                                                               zval_dtor(&zv_copy);
+                                                       }
+                                               }
+                                               zval_ptr_dtor(&zv);
+                                       }
+                               } else {
+                                       memcpy(offset, "NULL", 4);
+                                       offset += 4;
+                               }
+                       }
+
+                       if (++i < fptr->common.num_args) {
+                               *(offset++) = ',';
+                               *(offset++) = ' ';
+                       }
+                       arg_info++;
+                       REALLOC_BUF_IF_EXCEED(buf, offset, length, 23);
+               }
+       }
+       *(offset++) = ')';
+       *offset = '\0';
+
+       return buf;
+} 
+/* }}} */
+
+static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC) /* {{{ */
 {
        zend_uint child_flags;
        zend_uint parent_flags = parent->common.fn_flags;
@@ -3069,14 +3231,17 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
 
        if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
                if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
-                       zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
+                       zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC)); 
                }
        } else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
                if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
-                       zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(parent), parent->common.function_name);
+                       char *method_prototype = zend_get_function_declaration(child->common.prototype TSRMLS_CC);
+                       zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype); 
+                       efree(method_prototype);
                }
        }
 }
+/* }}} */
 
 static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, const zend_hash_key *hash_key, zend_class_entry *child_ce) /* {{{ */
 {
index 534b9abf323e2fd0dfbbea24ac2c45eba365efbe..e4a9c6853cdfb5e38ac61586365395e93fd0bdf6 100644 (file)
@@ -14,4 +14,4 @@ class bar extends php_user_filter {
 }
 ?>
 --EXPECTF--
-Strict Standards: Declaration of bar::filter() should be compatible with that of php_user_filter::filter() in %s on line %d
+Strict Standards: Declaration of bar::filter() should be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d
index 73a1f026725f6685abb4a161f6c63a88b436a8ba..2a1dbfdadfc24e53c9cbe6e15855ad16d968a713 100644 (file)
@@ -9,4 +9,4 @@ class foo extends php_user_filter {
 }
 ?>
 --EXPECTF--
-Strict Standards: Declaration of foo::filter() should be compatible with that of php_user_filter::filter() in %s on line %d
+Strict Standards: Declaration of foo::filter() should be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d
index 5962951eee84667f9d5e9bfc1ef583e7b3950b12..e9e0266381d2dc30db1f5ef6a6022abf1fa54ca5 100644 (file)
@@ -9,4 +9,4 @@ class foo extends php_user_filter {
 }
 ?>
 --EXPECTF--
-Strict Standards: Declaration of foo::onCreate() should be compatible with that of php_user_filter::onCreate() in %s on line %d
+Strict Standards: Declaration of foo::onCreate() should be compatible with php_user_filter::onCreate() in %s on line %d
index f6f9b66eabb9d6371009e2125fa09937b6ca47d3..e5ad30ebcd697577e3b0b0f9c2bc66689c7679e1 100755 (executable)
@@ -16,4 +16,4 @@ class implem implements constr
 
 ?>
 --EXPECTF--
-Fatal error: Declaration of implem::__construct() must be compatible with that of constr::__construct() in %s on line %d
+Fatal error: Declaration of implem::__construct() must be compatible with constr::__construct() in %s on line %d
index 953d6822fdf5cfda4a620025cd0a6bd92faa54e6..ac733312076298d6e52af22bf9e145ae859ffa87 100755 (executable)
@@ -20,4 +20,4 @@ class derived extends implem
 
 ?>
 --EXPECTF--
-Fatal error: Declaration of derived::__construct() must be compatible with that of constr::__construct() in %s on line %d
+Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d
index 0016244c18aae484f0bfcf8ef9954cd1cd2c43ff..94be655b83dfa527b77a5bc82674ab27108fcce5 100755 (executable)
@@ -23,4 +23,4 @@ class derived extends implem
 
 ?>
 --EXPECTF--
-Fatal error: Declaration of derived::__construct() must be compatible with that of constr::__construct() in %s on line %d
+Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d
index a22e5cce58f5840eb85df6f9315a31660f2a05be..1f4eafa537e60981c2250a84f6aabc0c29e238bb 100755 (executable)
@@ -17,5 +17,5 @@ class B extends A
 ===DONE===
 --EXPECTF--
 
-Strict Standards: Declaration of B::f() should be compatible with that of A::f() in %sinheritance_003.php on line %d
+Strict Standards: Declaration of B::f() should be compatible with A::f($x) in %sinheritance_003.php on line %d
 ===DONE===
index 9c81970cc2d0c1c6304809f2a9a9c392f5ddbcdd..d1f5faf5dac17d0dfadf6c0c4a88a414421fa143 100755 (executable)
@@ -17,5 +17,5 @@ class B extends A
 ===DONE===
 --EXPECTF--
 
-Strict Standards: Declaration of B::f() should be compatible with that of A::f() in %sinheritance_004.php on line %d
+Strict Standards: Declaration of B::f() should be compatible with A::f() in %sinheritance_004.php on line %d
 ===DONE===
index 53272fff737ee8d1479d908921ca732561b0cabb..333c29d128903f1799606f90fc06c522967cf730 100644 (file)
@@ -28,6 +28,6 @@ $b->foo(1);
 
 ?>
 --EXPECTF--
-Strict Standards: Declaration of C::foo() should be compatible with that of A::foo() in %s on line %d
+Strict Standards: Declaration of C::foo() should be compatible with A::foo($arg1 = 1) in %s on line %d
 int(1)
 int(3)
index c212b8260d4ad71a4f64e92a057951f8bad2f8bc..669a8ca8366917d94417420ed8da2984f6467244 100644 (file)
@@ -18,5 +18,5 @@ $b->foo();
 
 ?>
 --EXPECTF--
-Strict Standards: Declaration of B::foo() should be compatible with that of A::foo() in %s on line %d
+Strict Standards: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d
 foo
index d487a446113ec396522d993a836b7a4a2e7c3ba5..5e4c43b8af8ed4269df725fad2c1dd028ffba68e 100644 (file)
@@ -12,7 +12,7 @@ Class D2 extends C { function f(SomeClass $a) {} }
 ?>
 ==DONE==
 --EXPECTF--
-Strict Standards: Declaration of D2::f() should be compatible with that of C::f() in %s on line 8
+Strict Standards: Declaration of D2::f() should be compatible with C::f(array $a) in %s on line 8
 Compatible hint.
 Class hint, should be array.
-==DONE==
\ No newline at end of file
+==DONE==
index bc0d7686b5e59daa15d219fa9214dfdd2eb527a9..f13ab957bbb4e28a81065bfaac037d382f45665f 100644 (file)
@@ -9,6 +9,6 @@ Class D extends C { function f($a) {} }
 ?>
 ==DONE==
 --EXPECTF--
-Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5
+Strict Standards: Declaration of D::f() should be compatible with C::f(array $a) in %s on line 5
 No hint, should be array.
-==DONE==
\ No newline at end of file
+==DONE==
index d3b72412cd84f82feaa697748d06034cf323be5d..30a114e2a42efef9afcce9009fbc8634c4aebd60 100644 (file)
@@ -9,6 +9,6 @@ Class D extends C { function f(array $a) {} }
 ?>
 ==DONE==
 --EXPECTF--
-Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5
+Strict Standards: Declaration of D::f() should be compatible with C::f(SomeClass $a) in %s on line 5
 Array hint, should be class.
-==DONE==
\ No newline at end of file
+==DONE==
index 60dda0ff24a9c02c51b1b300566a6f5ca3891cfc..830054d03de109a66057927c0d3dabd5e4def174 100644 (file)
@@ -9,6 +9,6 @@ Class D extends C { function f(array $a) {} }
 ?>
 ==DONE==
 --EXPECTF--
-Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5
+Strict Standards: Declaration of D::f() should be compatible with C::f($a) in %s on line 5
 Array hint, should be nothing.
-==DONE==
\ No newline at end of file
+==DONE==