Skip to content

Commit eee6d3a

Browse files
committed
Invert conditions
1 parent 30996a9 commit eee6d3a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ext/soap/soap.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -714,20 +714,20 @@ PHP_METHOD(SoapFault, __toString)
714714
/* SoapFault uses typed properties */
715715
const zval *faultcode = zend_read_property(soap_fault_class_entry, Z_OBJ_P(this_ptr), "faultcode", sizeof("faultcode")-1, /* silent */ true, &rv1);
716716
const zend_string *faultcode_val;
717-
if (UNEXPECTED(Z_TYPE_P(faultcode) == IS_NULL)) {
718-
faultcode_val = zend_empty_string;
719-
} else {
720-
ZEND_ASSERT(Z_TYPE_P(faultcode) == IS_STRING);
717+
if (EXPECTED(Z_TYPE_P(faultcode) == IS_STRING)) {
721718
faultcode_val = Z_STR_P(faultcode);
719+
} else {
720+
ZEND_ASSERT(Z_TYPE_P(faultcode) == IS_NULL);
721+
faultcode_val = zend_empty_string;
722722
}
723723

724724
const zval *faultstring = zend_read_property(soap_fault_class_entry, Z_OBJ_P(this_ptr), "faultstring", sizeof("faultstring")-1, /* silent */ true, &rv2);
725725
const zend_string *faultstring_val;
726-
if (UNEXPECTED(Z_TYPE_P(faultstring) == IS_NULL)) {
727-
faultstring_val = zend_empty_string;
728-
} else {
729-
ZEND_ASSERT(Z_TYPE_P(faultstring) == IS_STRING);
726+
if (EXPECTED(Z_TYPE_P(faultstring) == IS_STRING)) {
730727
faultstring_val = Z_STR_P(faultstring);
728+
} else {
729+
ZEND_ASSERT(Z_TYPE_P(faultstring) == IS_NULL);
730+
faultstring_val = zend_empty_string;
731731
}
732732

733733
/* Exception uses typed properties */

0 commit comments

Comments
 (0)