]> granicus.if.org Git - php/commitdiff
Fix bug #71428
authorLevi Morrison <levim@php.net>
Thu, 5 May 2016 14:58:05 +0000 (08:58 -0600)
committerLevi Morrison <levim@php.net>
Thu, 5 May 2016 17:53:32 +0000 (11:53 -0600)
This also affects bug #72119

Zend/tests/bug71428.1.phpt
Zend/tests/bug71428.3.phpt
Zend/tests/bug72119.phpt
Zend/zend_inheritance.c

index 064e8cfa517ff1e6eb3a61be58329eb672db62a8..e4d3a22f670845f2da98896715ea4799a62658dc 100644 (file)
@@ -1,7 +1,5 @@
 --TEST--
 bug #71428.1: inheritance with null default values
---XFAIL--
-This is a BC break
 --FILE--
 <?php
 class A {
index 53e5129d89be01746d59802e25bebf87f0bb1b43..558e87c56e2e91ac501e3f026e6f636f95297d36 100644 (file)
@@ -1,7 +1,5 @@
 --TEST--
 bug #71428: Validation type inheritance with = NULL
---XFAIL--
-This is a BC break
 --FILE--
 <?php
 class A { }
index eb9b4a73a7899c70caa92ef00018acf3ed89838b..064381ada05e03dd3cde4126f560ecd5a09c01ca 100644 (file)
@@ -14,6 +14,6 @@ class Hello implements Foo {
 }
 echo "OK\n";
 ?>
---EXPECT--
-OK
+--EXPECTF--
+Fatal error: Declaration of Hello::bar(array $baz = Array) must be compatible with Foo::bar(?array $baz = NULL) in %s on line %d
 
index de9b63e342676bc149cb41cabb70b9ef05dba6d3..879e00375cb15bf44ec3d92979e9a4a7e45b9ae3 100644 (file)
@@ -319,13 +319,11 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
                        return 0;
                }
 
-#if 0
                // This introduces BC break described at https://bugs.php.net/bug.php?id=72119
                if (proto_arg_info->type_hint && proto_arg_info->allow_null && !fe_arg_info->allow_null) {
                        /* incompatible nullability */
                        return 0;
                }
-#endif
 
                /* by-ref constraints on arguments are invariant */
                if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) {