diff options
author | twosee <twose@qq.com> | 2020-06-08 18:45:01 +0800 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-06-08 15:31:52 +0200 |
commit | 83a77015ad0dcd25d30342a08cbc8ec3de077305 (patch) | |
tree | 3039af88d8bb809f98698bc4bcb282da9f374a14 /ext/tokenizer | |
parent | 543684e7962073dcae3ecdd9504211876e630bec (diff) | |
download | php-git-83a77015ad0dcd25d30342a08cbc8ec3de077305.tar.gz |
Add helper APIs for maybe-interned string creation
Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using
ZVAL_INTERNED_STRING and ZSTR_CHAR.
Add zend_string_init_fast() as a helper for the empty string /
one char interned string / zend_string_init() pattern.
Also add corresponding ZVAL_STRINGL_FAST etc macros.
Closes GH-5684.
Diffstat (limited to 'ext/tokenizer')
-rw-r--r-- | ext/tokenizer/tokenizer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index 901e609d2d..866977397d 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -226,7 +226,7 @@ PHP_METHOD(PhpToken, getTokenName) } if (Z_LVAL_P(id_zval) < 256) { - RETURN_INTERNED_STR(ZSTR_CHAR(Z_LVAL_P(id_zval))); + RETURN_CHAR(Z_LVAL_P(id_zval)); } else { const char *token_name = get_token_type_name(Z_LVAL_P(id_zval)); if (!token_name) { |