1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Merge branch 'PHP-8.3'

* PHP-8.3:
  strtok is not comptime()
This commit is contained in:
Ilija Tovilo
2024-01-14 19:13:25 +01:00
3 changed files with 18 additions and 3 deletions

16
Zend/tests/gh13145.phpt Normal file
View 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"

View File

@@ -2355,7 +2355,6 @@ function implode(string|array $separator, ?array $array = null): string {}
function join(string|array $separator, ?array $array = null): string {}
/**
* @compile-time-eval
* @refcount 1
*/
function strtok(string $string, ?string $token = null): string|false {}

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: a9603577b33f1a20150c9da6251c69d26686cf0b */
* Stub hash: afccfc7a2e1a52e73f3c05e4f7f3a994f86eb881 */
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)
@@ -3079,7 +3079,7 @@ static const zend_function_entry ext_functions[] = {
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(explode, arginfo_explode)
ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(implode, arginfo_implode)
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(strtolower, arginfo_strtolower)
ZEND_FE(str_increment, arginfo_str_increment)