#26768 [NEW]: substr_replace don't replace
| From: | pb at tdcspace dot dk | Date: | Fri, 02 Jan 2004 16:49:38 +0000 |
| Subject: | #26768 [NEW]: substr_replace don't replace | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-52721@lists.php.net to get a copy of this message | ||
From: pb at tdcspace dot dk
Operating system: NT
PHP version: Irrelevant
PHP Bug Type: Unknown/Other Function
Bug description: substr_replace don't replace
Description:
------------
PHP 4.3.1 running on a web-host with NT!
Note: YES - i have tried to search for this bug !
A php-script to replace (change) varnames in other php-scripts. Quite
simple - but it only works on smaller files i.e. substr_replace apparently
does not work on a string of about 10k. Bug is: nothing is replaced by
substr_replace but
returned unchanged !
short code ex:
$x = file_get_contents($fn); // read source into string
$x = strtolower($x); // make lowercase for search
$p = strpos($x, $oldvarname); // find varname
$x = substr_replace($x, $newvarname, $p, strlen($oldname));
...save the string to a file with changed varnames
as said - it works on smaller files/strings (2k) but not if the
file/string is - say - 10k.
--
Edit bug report at http://bugs.php.net/?id=26768&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26768&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26768&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26768&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26768&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26768&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26768&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26768&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26768&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26768&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26768&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26768&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26768&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26768&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26768&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26768&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26768&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26768&r=float