From: Zeev Suraski Date: Mon, 4 Aug 2003 07:53:09 +0000 (+0000) Subject: Simplify code using XOR X-Git-Tag: RELEASE_1_2b5~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1959133fb3cc04786adc12942d5c2ea417a556ae;p=php Simplify code using XOR --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 1ff9bb1e37..894b96c15c 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1607,15 +1607,12 @@ static zend_bool zend_do_perform_implementation_check(zend_function *fe) } for (i=0; i< fe->common.num_args; i++) { - if (fe->common.arg_info[i].class_name) { - if (fe->common.prototype->common.arg_info[i].class_name) { - if (strcmp(fe->common.arg_info[i].class_name, fe->common.prototype->common.arg_info[i].class_name)!=0) { - return 0; - } - } else { - return 0; - } - } else if (fe->common.prototype->common.arg_info[i].class_name) { + if (ZEND_LOG_XOR(fe->common.arg_info[i].class_name, fe->common.prototype->common.arg_info[i].class_name)) { + /* Only one has a type hint and the other one doesn't */ + return 0; + } + if (fe->common.arg_info[i].class_name + && strcmp(fe->common.arg_info[i].class_name, fe->common.prototype->common.arg_info[i].class_name)!=0) { return 0; } if (fe->common.arg_info[i].pass_by_reference != fe->common.prototype->common.arg_info[i].pass_by_reference) {