Category
stdlib
Problem
wordwrap() argument #2 ($width) is parsed as Z_PARAM_LONG in php-src (float truncated, numeric strings accepted). This compiler requires strict integer types and rejects valid Zend calls.
php-src reference
Repro (failure today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php -r "echo wordwrap(\"hello\", 1.9), \"\\n\"; echo wordwrap(\"hello\", \"2\"), \"\\n\";"
php bin/vm.php -r "echo wordwrap(\"hello\", 1.9), \"\\n\"; echo wordwrap(\"hello\", \"2\"), \"\\n\";" 2>&1 || true
'
| Call |
Zend PHP 8.2 |
This compiler |
wordwrap('hello', 1.9) |
hello (width 1) |
LogicException |
wordwrap('hello', '2') |
wrapped at width 2 |
LogicException |
Scope (this repo)
ext/standard/wordwrap.php, ext/standard/VmString.php::wordwrap()
- JIT:
ext/standard/JitWordwrap.php — coerce width before __compiler_wordwrap
test/compliance/cases/stdlib/wordwrap_width_coerce.phpt
Done when
Related
Category
stdlibProblem
wordwrap()argument #2 ($width) is parsed asZ_PARAM_LONGin php-src (float truncated, numeric strings accepted). This compiler requires strict integer types and rejects valid Zend calls.php-src reference
ext/standard/string.c—PHP_FUNCTION(wordwrap)/php_wordwrapRepro (failure today)
wordwrap('hello', 1.9)hello(width 1)LogicExceptionwordwrap('hello', '2')LogicExceptionScope (this repo)
ext/standard/wordwrap.php,ext/standard/VmString.php::wordwrap()ext/standard/JitWordwrap.php— coerce width before__compiler_wordwraptest/compliance/cases/stdlib/wordwrap_width_coerce.phptDone when
'abc',[]) →TypeError/ValueErrorper Zend./script/ci-fast.sh --filter wordwrap_widthgreenRelated