Doc #78934 [NEW]: What does mb_substr() return when it fails?
From: anthony_rutledge_101 at yahoo dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:What does mb_substr() return when it fails?
Description:
------------
---
From manual page: https://php.net/function.mb-substr
---
Hi. Short and sweet. Would you please add what mb_substr() returns when
it fails to the manual page? Thank you. I would have given you the
answer, but my PHP 7.2.7 on Windows (legacy) does not have the
multi-byte extension installed. I'm moving to PHP 7.4 anyway.
Test script:
---------------
The manual is the issue, not the function (as far as I know).
Still, to save you time. :-)
mb_internal_encoding("UTF-8");
$name = "Anthony";
echo $name . "<br>";
$newName = mb_substr($name, 0, 7);
echo $newName . "<br>";
$badName = mb_substr($name, 0, 20);
echo $badName . "<br>";
$badName = mb_substr($name, 20, 20);
echo $badName . "<br>";
--
Edit bug report at https://bugs.php.net/bug.php?id=78934&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78934&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78934&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78934&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78934&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78934&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78934&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78934&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78934&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78934&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78934&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78934&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78934&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78934&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78934&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78934&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78934&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78934&r=mysqlcfg
Thread (5 messages)
- anthony_rutledge_101 at yahoo dot com