Skip to content

Commit cbd2011

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: strtok is not comptime()
2 parents 9c7b391 + ed64949 commit cbd2011

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

Zend/tests/gh13145.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
GH-13145: strtok() misoptimization
3+
--FILE--
4+
<?php
5+
$tok = strtok("This is\tan example\nstring", " \n\t");
6+
while ($tok !== false) {
7+
var_dump($tok);
8+
$tok = strtok(" \n\t");
9+
}
10+
?>
11+
--EXPECT--
12+
string(4) "This"
13+
string(2) "is"
14+
string(2) "an"
15+
string(7) "example"
16+
string(6) "string"

ext/standard/basic_functions.stub.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,6 @@ function implode(string|array $separator, ?array $array = null): string {}
23552355
function join(string|array $separator, ?array $array = null): string {}
23562356

23572357
/**
2358-
* @compile-time-eval
23592358
* @refcount 1
23602359
*/
23612360
function strtok(string $string, ?string $token = null): string|false {}

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)