#26768 [Fbk->Csd]: substr_replace don't replace
| From: | pb at tdcspace dot dk | Date: | Fri, 02 Jan 2004 22:57:15 +0000 |
| Subject: | #26768 [Fbk->Csd]: substr_replace don't replace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-52736@lists.php.net to get a copy of this message | ||
ID: 26768
User updated by: pb at tdcspace dot dk
Reported By: pb at tdcspace dot dk
-Status: Feedback
+Status: Closed
Bug Type: Unknown/Other Function
Operating System: NT
PHP Version: Irrelevant
New Comment:
one own bugs is not anothers - subject closed
Previous Comments:
------------------------------------------------------------------------
[2004-01-02 12:47:40] jay@php.net
This is a pretty old version of PHP. Can you try using the
latest version, PHP 4.3.4?
J
------------------------------------------------------------------------
[2004-01-02 11:49:38] pb at tdcspace dot dk
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 this bug report at http://bugs.php.net/?id=26768&edit=1