From 196b9517281aebd972e7f287433aa97af2e06087 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 15 May 2015 01:11:29 +0300 Subject: [PATCH] Optimized === and !== with NULL, FALSE, TRUE. --- Zend/zend_operators.h | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.40.0