diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-30 10:42:47 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-30 10:42:47 +0200 |
| commit | 7e776175337432ce04d24a8474ff45bc3a3c9453 (patch) | |
| tree | bf464fb6e5544f6f488743b63d57c7dfe7adf18d | |
| parent | 9372b6876d72d22ea293bca5f35e5d5820423ce9 (diff) | |
| parent | 19e7e4b19717d0b66c0aad39992c5d98e62bf10e (diff) | |
| download | php-git-7e776175337432ce04d24a8474ff45bc3a3c9453.tar.gz | |
Merge branch 'PHP-7.4'
| -rw-r--r-- | Zend/zend_language_scanner.l | 3 | ||||
| -rw-r--r-- | ext/tokenizer/tests/php_tag_only.phpt | 2 | ||||
| -rw-r--r-- | ext/tokenizer/tests/php_tag_only_2.phpt | 23 |
3 files changed, 27 insertions, 1 deletions
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index dcf11bef5e..27fb296d58 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -2057,7 +2057,8 @@ inline_char_handler: if (CG(short_tags) /* <? */ || (*(YYCURSOR + 1) == '=') /* <?= */ || (!strncasecmp((char*)YYCURSOR + 1, "php", 3) && /* <?php[ \t\r\n] */ - (YYCURSOR[4] == ' ' || YYCURSOR[4] == '\t' || + (YYCURSOR + 4 == YYLIMIT || + YYCURSOR[4] == ' ' || YYCURSOR[4] == '\t' || YYCURSOR[4] == '\n' || YYCURSOR[4] == '\r')) ) { YYCURSOR--; diff --git a/ext/tokenizer/tests/php_tag_only.phpt b/ext/tokenizer/tests/php_tag_only.phpt index aec11f9e16..3d51e0cea5 100644 --- a/ext/tokenizer/tests/php_tag_only.phpt +++ b/ext/tokenizer/tests/php_tag_only.phpt @@ -2,6 +2,8 @@ Tokenization of only the <?php tag --SKIPIF-- <?php if (!extension_loaded("tokenizer")) print "skip tokenizer extension not enabled"; ?> +--INI-- +short_open_tag=1 --FILE-- <?php diff --git a/ext/tokenizer/tests/php_tag_only_2.phpt b/ext/tokenizer/tests/php_tag_only_2.phpt new file mode 100644 index 0000000000..60e4004179 --- /dev/null +++ b/ext/tokenizer/tests/php_tag_only_2.phpt @@ -0,0 +1,23 @@ +--TEST-- +Tokenization of only the <?php tag +--SKIPIF-- +<?php if (!extension_loaded("tokenizer")) print "skip tokenizer extension not enabled"; ?> +--INI-- +short_open_tag=0 +--FILE-- +<?php + +foreach (token_get_all("<?php") as $token) { + echo token_name($token[0]), "\n"; +} +echo "\n"; +foreach (token_get_all("Foobar<?php") as $token) { + echo token_name($token[0]), "\n"; +} + +?> +--EXPECT-- +T_OPEN_TAG + +T_INLINE_HTML +T_OPEN_TAG |
