From:             prof_moriarty at veryfast dot biz
Operating system: win 98SE
PHP version:      4.3.4
PHP Bug Type:     Regexps related
Bug description:  preg_replace crashes PHP

Description:
------------
There seem to be some major issues with preg_replace in this version.

See code actual and reproducable for explanations

Reproduce code:
---------------
$string = "ship_id = '17' ||";

$string = preg_replace("/\|\| $/", "", $string);

echo $string;

Expected result:
----------------
SHOULD result in

ship_id = '17'


being printed to the screen.

Actual result:
--------------
PHP crashes.
Indeed it would seem absolutely anything i enter as either the regexp, or
the string will crash it. Even if both are blank.


Below is the 'details' of the error (as gained from windows thing):

"
PHP caused an invalid page fault in
module <unknown> at 0000:854fd78b.
Registers:
EAX=0000004c CS=016f EIP=854fd78b EFLGS=00010246
EBX=0063f474 SS=0177 ESP=0063f330 EBP=10135328
ECX=00000000 DS=0177 ESI=0000004c FS=96a7
EDX=0000008a ES=0177 EDI=007d68cc GS=0000
Bytes at CS:EIP:
00 2e 00 05 00 2e 00 05 00 2e 00 05 00 2e 00 05 
Stack dump:
011750f4 ffffffff 10135328 10135328 01010101 01010101 01010101 00100101
0000004c 00100010 01820010 00000000 00000000 0102014c 01020102 01020102 
"

-- 
Edit bug report at http://bugs.php.net/?id=26363&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26363&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26363&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26363&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26363&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26363&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26363&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26363&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26363&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26363&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26363&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26363&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26363&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26363&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26363&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26363&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26363&r=float

Reply via email to