From: Dmitry Stogov Date: Thu, 14 May 2015 22:11:29 +0000 (+0300) Subject: Optimized === and !== with NULL, FALSE, TRUE. X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~42^2~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=196b9517281aebd972e7f287433aa97af2e06087;p=php Optimized === and !== with NULL, FALSE, TRUE. --- diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 5e16bf87f4..c026f23415 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -848,6 +848,8 @@ static zend_always_inline int fast_is_identical_function(zval *op1, zval *op2) { if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { return 0; + } else if (Z_TYPE_P(op1) <= IS_TRUE) { + return 1; } return zend_is_identical(op1, op2); } @@ -856,6 +858,8 @@ static zend_always_inline int fast_is_not_identical_function(zval *op1, zval *op { if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { return 1; + } else if (Z_TYPE_P(op1) <= IS_TRUE) { + return 0; } return !zend_is_identical(op1, op2); }