#24375 [NEW]: php.exe - Application error caused when I execute preg_replace

From: Date: Sat, 28 Jun 2003 17:10:55 +0000
Subject: #24375 [NEW]: php.exe - Application error caused when I execute preg_replace
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-42676@lists.php.net to get a copy of this message
From: zvorygin at kenjitsu dot net Operating system: Win2000 PHP version: 4.3.1 PHP Bug Type: PCRE related Bug description: php.exe - Application error caused when I execute preg_replace Description: ------------ I wrote a simple program which had to replace some strings in file using regular expressions and display the reult. I used next sample templatesource_text here: --------------------- <!--%seclevel_num="0"--> <!--%description_text="Default header"--> <html> <head> <title><!--#TITLE--></title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> </head> <body> ---------------------- Reproduce code: --------------- ------------------- include("classes//class_template.php"); $templ= new template(); $templ->templatedir_text="template//default//"; $templ->loadTemplate("default_header.html"); echo($templ->applyTransform()); ------------------- function applyTransform $matches_array=NULL,$replace_array=NULL){ $repl=array("qwerty1","qwerty2","qwerty3","qwerty4"); $text=$this->templatesource_text; return preg_replace("/<!--#(.*)-->/U",$repl,$text); ------------------- Expected result: ---------------- I was expected to see may be warning, or error, but NOT application error. Also when I use "preg_replace("/<!--%(.*)-->/U",$repl,$text);" everythjing is fine Actual result: -------------- php.exe-application error The instruction at "0x10074d7e" referenced memory at "0x00a4a000" the memory could not be "read"... -- Edit bug report at http://bugs.php.net/?id=24375&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24375&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24375&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24375&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24375&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24375&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24375&r=support Expected behavior: http://bugs.php.net/fix.php?id=24375&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24375&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24375&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24375&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24375&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24375&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24375&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24375&r=gnused

« previous php.bugs (#42676) next »