#36731 [Opn->Bgs]: memory limit exceed by str_replace??
| From: | tony2001@php.net | Date: | Tue, 14 Mar 2006 07:24:17 +0000 |
| Subject: | #36731 [Opn->Bgs]: memory limit exceed by str_replace?? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-94324@lists.php.net to get a copy of this message | ||
ID: 36731
Updated by: tony2001@php.net
Reported By: prezident at terix dot ru
-Status: Open
+Status: Bogus
Bug Type: Performance problem
Operating System: ???
PHP Version: 5.1.2
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2006-03-14 01:27:01] prezident at terix dot ru
error handles in 10th line of listed code (when its commented, all is
good)
------------------------------------------------------------------------
[2006-03-14 01:21:30] prezident at terix dot ru
Description:
------------
When i make str_replace on foreach server gives me error #500
Reproduce code:
---------------
function bhldr($parser, $name, $att) {
$this->depth++;
if ($this->snipplets[$name]) {
$this->mode[$this->depth] = $name;
return '';
}
if ($this->inlines[$name]) {
$inl = $this->inlines[$name];
foreach ($att as $key=>$val) {
$inl = str_replace('#'.$key.'#', $val, $inl);
}
$this->result .= $inl;
return '';
}
$this->result .= str_repeat("\t", $this->depth)."<$name";
foreach ($att as $key=>$val) $this->result .= " $key='$val'";
$this->result .= ">\r\n";
}
Expected result:
----------------
parsed xml with tags, listed on array $this->inlines as keys, replaced
with values of $this->inlines. Additionally, in the values
constructions like "#WIDTH#" must be replaced with $att[] values (i.e.,
#WIDTH# to $att["WIDTH"]).
Function bhldr is xml_begin_element_handler.
Actual result:
--------------
Memory issue. My hoster gives max 10MB of RAM for PHP5 (started as
CGI).
here error message from Apache error log:
Mar 14 02:59:17 2006] [error] [client #.#.#.#] Premature end of script
headers: /usr/local/php5-cgi/domain/php
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36731&edit=1