Doc #77994 [NEW]: Missing Detail in str_replace Documentation

From: Date: Thu, 09 May 2019 06:13:09 +0000
Subject: Doc #77994 [NEW]: Missing Detail in str_replace Documentation
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16634@lists.php.net to get a copy of this message
From: mark at manngo dot net Operating system: PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:Missing Detail in str_replace Documentation Description: ------------ --- From manual page: https://php.net/function.str-replace --- The document makes no mention of what happens if the replace array is smaller than the search array. It appears that the search characters will be replaced with an empty string. This may or may not be expected, as the alternative result might have been to ignore the characters. Test script: --------------- $string='apple banana cherry apple banana cherry apple banana cherry'; $search=['apple','banana']; $replace=['accordion','banjo']; print str_replace($search,$replace,$string); print "\n"; $replace=['accordion']; print str_replace($search,$replace,$string); -- Edit bug report at https://bugs.php.net/bug.php?id=77994&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77994&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77994&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77994&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77994&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77994&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77994&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77994&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77994&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77994&r=support Expected behavior: https://bugs.php.net/fix.php?id=77994&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77994&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77994&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77994&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77994&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77994&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77994&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77994&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77994&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77994&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77994&r=mysqlcfg

« previous php.doc.bugs (#16634) next »