Req #52362 [NEW]: give str_ireplace an option to refer the original string

From: Date: Fri, 16 Jul 2010 12:13:22 +0000
Subject: Req #52362 [NEW]: give str_ireplace an option to refer the original string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-152479@lists.php.net to get a copy of this message
From: Operating system: PHP version: 5.3.2 Package: *General Issues Bug Type: Feature/Change Request Bug description:give str_ireplace an option to refer the original string Description: ------------ Currently I can search case-insensitive with str_ireplace. But when I need the original string in the replacement I have to use preg_replace//i. It would be nice to have the original text in a "magic variable" like $1 to avoid using the "expensive" preg-engine. Test script: --------------- currently: print str_ireplace ("original", "<b>original</b>", "the ORIGINAL text"); idea: print str_ireplace ("original", "<b>$1</b>", "the ORIGINAL text"); Expected result: ---------------- the <b>original</b> text Actual result: -------------- the <b>ORIGINAL</b> text -- Edit bug report at http://bugs.php.net/bug.php?id=52362&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52362&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52362&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52362&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52362&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52362&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52362&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52362&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52362&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52362&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52362&r=support Expected behavior: http://bugs.php.net/fix.php?id=52362&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52362&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52362&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52362&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52362&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52362&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52362&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52362&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52362&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52362&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52362&r=mysqlcfg

« previous php.bugs (#152479) next »