Bug #76197 [NEW]: White space not returned by substr

From: Date: Sun, 08 Apr 2018 16:03:16 +0000
Subject: Bug #76197 [NEW]: White space not returned by substr
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214647@lists.php.net to get a copy of this message
From: laurent dot couraud at c2n dot upsaclay dot fr Operating system: Windows PHP version: 7.2.4 Package: Strings related Bug Type: Bug Bug description:White space not returned by substr Description: ------------ all string related function i did test (substr, mb_substr, iconv_substr) return a empty string when the result should be one space character. Test script: --------------- // Source code saved in UTF-8 encoding. $string = 'a b'; $c1 = substr($string, 1, 1); $c2 = mb_substr($string, 1, 1); $c3 = iconv_substr($string, 1, 1); // then we obtain: // $c1 == $c2 == $c3 == "" // instead of // $c1 == $c2 == $c3 == " " -- Edit bug report at https://bugs.php.net/bug.php?id=76197&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76197&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76197&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76197&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76197&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76197&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76197&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76197&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76197&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76197&r=support Expected behavior: https://bugs.php.net/fix.php?id=76197&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76197&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76197&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76197&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76197&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76197&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76197&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76197&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76197&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76197&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76197&r=mysqlcfg

« previous php.bugs (#214647) next »