[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] com php-src: Swap type check order: =?UTF-8?Q?Zend/zend=5Finheritance=2Ec?=
From:       Aaron Piotrowski <trowski () php ! net>
Date:       2016-06-29 14:36:33
Message-ID: php-mail-a743f92d883fdf2384d7e739775409e6657948921 () git ! php ! net
[Download RAW message or body]

Commit:    583386d59e6b362fe49e51594718a109d0c0cc2f
Author:    Aaron Piotrowski <aaron@trowski.com>         Wed, 29 Jun 2016 09:36:33 \
                -0500
Parents:   0dc772c9b4466de45c47c6a5222b7d3464dcfa2c
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=583386d59e6b362fe49e51594718a109d0c0cc2f


Log:
Swap type check order

Changed paths:
  M  Zend/zend_inheritance.c


Diff:
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 6c3dc74..7dc6bfc 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -167,9 +167,9 @@ char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
 }
 /* }}} */
 
-static zend_bool zend_iterable_type_check(zend_arg_info *arg_info) /* {{{ */
+static zend_always_inline zend_bool zend_iterable_compatibility_check(zend_arg_info \
*arg_info) /* {{{ */  {
-	if (arg_info->type_hint == IS_ITERABLE || arg_info->type_hint == IS_ARRAY) {
+	if (arg_info->type_hint == IS_ARRAY) {
 		return 1;
 	}
 	
@@ -329,12 +329,17 @@ static zend_bool zend_do_perform_implementation_check(const \
zend_function *fe, c  proto_arg_info = \
&proto->common.arg_info[proto->common.num_args];  }
 		
-		if (fe_arg_info->type_hint == IS_ITERABLE) {
-			if (!zend_iterable_type_check(proto_arg_info)) {
-				return 0;
+		if (!zend_do_perform_type_hint_check(fe, fe_arg_info, proto, proto_arg_info)) {
+			switch (fe_arg_info->type_hint) {
+				case IS_ITERABLE:
+					if (!zend_iterable_compatibility_check(proto_arg_info)) {
+						return 0;
+					}
+					break;
+					
+				default:
+					return 0;
 			}
-		} else if (!zend_do_perform_type_hint_check(fe, fe_arg_info, proto, \
                proto_arg_info)) {
-			return 0;
 		}
 
 		// This introduces BC break described at https://bugs.php.net/bug.php?id=72119
@@ -357,12 +362,17 @@ static zend_bool zend_do_perform_implementation_check(const \
zend_function *fe, c  return 0;
 		}
 		
-		if (proto->common.arg_info[-1].type_hint == IS_ITERABLE) {
-			if (!zend_iterable_type_check(fe->common.arg_info - 1)) {
-				return 0;
+		if (!zend_do_perform_type_hint_check(fe, fe->common.arg_info - 1, proto, \
proto->common.arg_info - 1)) { +			switch (proto->common.arg_info[-1].type_hint) {
+				case IS_ITERABLE:
+					if (!zend_iterable_compatibility_check(fe->common.arg_info - 1)) {
+						return 0;
+					}
+					break;
+					
+				default:
+					return 0;
 			}
-		} else if (!zend_do_perform_type_hint_check(fe, fe->common.arg_info - 1, proto, \
                proto->common.arg_info - 1)) {
-			return 0;
 		}
 
 		if (fe->common.arg_info[-1].allow_null && !proto->common.arg_info[-1].allow_null) \
{


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic