diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-04-21 22:36:01 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-04-21 22:36:01 +0400 |
commit | 4ed452c1b5b81f99212594ec7f57475a16372d45 (patch) | |
tree | 4104a7e27992094294b6305ece067ee928bb3007 /Zend/zend_operators.h | |
parent | 8ad8254a16bd5d3771e72a1a1c0ca3fc9551d43f (diff) | |
download | php-git-4ed452c1b5b81f99212594ec7f57475a16372d45.tar.gz |
Convert zval_get_string() into "fast path" macro and "slow path" function
Diffstat (limited to 'Zend/zend_operators.h')
-rw-r--r-- | Zend/zend_operators.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 9df4a68933..f026ae1dbc 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -339,7 +339,10 @@ ZEND_API void multi_convert_to_string_ex(int argc, ...); ZEND_API long zval_get_long(zval *op TSRMLS_DC); ZEND_API double zval_get_double(zval *op TSRMLS_DC); -ZEND_API zend_string *zval_get_string(zval *op TSRMLS_DC); +ZEND_API zend_string *_zval_get_string_func(zval *op TSRMLS_DC); + +#define zval_get_string(op) ((Z_TYPE_P(op) == IS_STRING) ? \ + STR_COPY(Z_STR_P(op)) : _zval_get_string_func((op) TSRMLS_CC)) ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2); ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2); |