mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
strtok is not comptime()
Fixes GH-13145 Closes GH-13148
This commit is contained in:
parent
00ea756c93
commit
ed64949d12
4 changed files with 21 additions and 3 deletions
3
NEWS
3
NEWS
|
@ -10,6 +10,9 @@ PHP NEWS
|
||||||
. Fixed bug GH-12996 (Incorrect SCRIPT_NAME with Apache ProxyPassMatch when
|
. Fixed bug GH-12996 (Incorrect SCRIPT_NAME with Apache ProxyPassMatch when
|
||||||
plus in path). (Jakub Zelenka)
|
plus in path). (Jakub Zelenka)
|
||||||
|
|
||||||
|
- Opcache:
|
||||||
|
. Fixed bug GH-13145 (strtok() is not comptime). (ilutov)
|
||||||
|
|
||||||
- Phar:
|
- Phar:
|
||||||
. Fixed bug #71465 (PHAR doesn't know about litespeed). (nielsdos)
|
. Fixed bug #71465 (PHAR doesn't know about litespeed). (nielsdos)
|
||||||
|
|
||||||
|
|
16
Zend/tests/gh13145.phpt
Normal file
16
Zend/tests/gh13145.phpt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
--TEST--
|
||||||
|
GH-13145: strtok() misoptimization
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$tok = strtok("This is\tan example\nstring", " \n\t");
|
||||||
|
while ($tok !== false) {
|
||||||
|
var_dump($tok);
|
||||||
|
$tok = strtok(" \n\t");
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
string(4) "This"
|
||||||
|
string(2) "is"
|
||||||
|
string(2) "an"
|
||||||
|
string(7) "example"
|
||||||
|
string(6) "string"
|
|
@ -2337,7 +2337,6 @@ function implode(string|array $separator, ?array $array = null): string {}
|
||||||
function join(string|array $separator, ?array $array = null): string {}
|
function join(string|array $separator, ?array $array = null): string {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @compile-time-eval
|
|
||||||
* @refcount 1
|
* @refcount 1
|
||||||
*/
|
*/
|
||||||
function strtok(string $string, ?string $token = null): string|false {}
|
function strtok(string $string, ?string $token = null): string|false {}
|
||||||
|
|
4
ext/standard/basic_functions_arginfo.h
generated
4
ext/standard/basic_functions_arginfo.h
generated
|
@ -1,5 +1,5 @@
|
||||||
/* This is a generated file, edit the .stub.php file instead.
|
/* This is a generated file, edit the .stub.php file instead.
|
||||||
* Stub hash: 487cee0751d47b18bf0a8fbdb050313783f1b369 */
|
* Stub hash: 7389d094a842a2289cd32cb37386e5e40ea7e031 */
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
|
||||||
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
|
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
|
||||||
|
@ -3087,7 +3087,7 @@ static const zend_function_entry ext_functions[] = {
|
||||||
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(explode, arginfo_explode)
|
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(explode, arginfo_explode)
|
||||||
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(implode, arginfo_implode)
|
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(implode, arginfo_implode)
|
||||||
ZEND_FALIAS(join, implode, arginfo_join)
|
ZEND_FALIAS(join, implode, arginfo_join)
|
||||||
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtok, arginfo_strtok)
|
ZEND_FE(strtok, arginfo_strtok)
|
||||||
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtoupper, arginfo_strtoupper)
|
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtoupper, arginfo_strtoupper)
|
||||||
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtolower, arginfo_strtolower)
|
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(strtolower, arginfo_strtolower)
|
||||||
ZEND_FE(str_increment, arginfo_str_increment)
|
ZEND_FE(str_increment, arginfo_str_increment)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue