|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-06-28 12:37 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2018-06-28 12:37 UTC] cmb@php.net
[2018-06-28 18:00 UTC] cmb@php.net
[2018-06-28 21:06 UTC] nikic@php.net
[2018-06-28 21:06 UTC] nikic@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 03:00:01 2025 UTC |
Description: ------------ mb_strimwidth returns an empty string for $width > 2147483647 mb_strimwidth requires memory greater than $width - 2GB for the provided test script Affected versions (as far as I can test): - PHP 5.6.36-pl0-gentoo (cli and fpm) - PHP 7.2.6 (cli and fpm) Test script: --------------- <?php declare(strict_types=1); function doIt(int $width): void { $string_to_trim = 'some test string'; $expected_result = $string_to_trim; $actual_result = mb_strimwidth($string_to_trim, 0, $width); echo <<<RESULT Width: $width String to trim: $string_to_trim Expected result: $expected_result Acutal result: $actual_result RESULT; } $width = 2147483647; doIt($width); doIt($width + 1); echo memory_get_peak_usage(true); Expected result: ---------------- Width: 2147483647 String to trim: some test string Expected result: some test string Acutal result: some test string Width: 2147483648 String to trim: some test string Expected result: some test string Acutal result: some test string 2149580800 Actual result: -------------- Width: 2147483647 String to trim: some test string Expected result: some test string Acutal result: some test string Width: 2147483648 String to trim: some test string Expected result: some test string Acutal result: 2149580800