ID: 13901
Updated by: andrei
Reported By: [EMAIL PROTECTED]
Status: Assigned
Bug Type: Reproducible crash
Operating System: Linux PPC (2.2.18) and MacOSX 10
PHP Version: 4.0.6
Assigned To: andrei
New Comment:

Fixed in CVS - thanks.

Previous Comments:
------------------------------------------------------------------------

[2001-11-01 14:54:51] [EMAIL PROTECTED]

I'm using str_replace to fill out mailing label templates with data from a database. 
When I came up with a record with empty string fields I got a seqfault. I've tracked 
the problem down to str_replace -- simplified in the following script. If you insert a 
space in $replaceArray['NAME'] or add a space at the end of $lines[0] after {name} it 
won't segfault. Note that the ADDRESS field has the same layout, but doesn't cause a 
segfault, however if I reduce the arrays to *just* the NAME fields, then it doesn't 
segfault either. Weirdness.

<?php
$searchArray = array (
    "NAME" => "{name}",
    "ADDRESS" => "{address}" );
$replaceArray = array (
    "NAME" => "",
    "ADDRESS" => "" );
$lines = array(
    "{name}",
    "{address}",
    "",
    ""
    );
$newlines = str_replace($searchArray, $replaceArray, $lines);

print_r($lines);
print("<br>\n");
print_r($newlines);
print("<br>\n");
?>

On MacOSX I used this configuration:
        --with-xml \
        --with-zlib \
        --with-apxs=/usr/sbin/apxs \
        --with-openssl \
        --enable-trans-sid \
        --with-pdflib=/Users/steve/build/pdflib/pdflib-4.0.1/bind/c \   
--enable-shared=pdflib \
        --with-mysql=/usr/local

On Linux PPC (2.2.18) I used this configuration:
       --with-xml \
        --with-zlib \
        --with-apxs=/usr/sbin/apxs \
        --with-openssl \
        --enable-trans-sid \
        --with-pdflib=/usr/local \
        --enable-shared=pdflib \
        --with-mysql=/usr \
        --enable-openbase_module


------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=13901&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to