ID: 27299
Updated by: [EMAIL PROTECTED]
Reported By: john at supernerd dot com
Status: Open
Bug Type: PCRE related
Operating System: Windows 2000
PHP Version: 4.3.4
New Comment:
works fine on mac/linux.
Previous Comments:
------------------------------------------------------------------------
[2004-02-17 21:19:45] john at supernerd dot com
Description:
------------
returns an error of
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in
C:\Documents and Settings\john\Desktop\ttms
desktop\php\gui\Smarty_Compiler.class.php(288) : regexp code on line 2
Reproduce code:
---------------
$ldq = preg_quote('{', '!');
$rdq = preg_quote('}', '!');
$search =
"!{$ldq}\*(.*?)\*{$rdq}|{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}|{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}!s";
$source_content = preg_replace($search.'e', "'"
. '{' . 'php'
. "' . str_repeat(\"\n\",
substr_count('\\0', \"\n\")) .'"
. '}'
. "'",
"a
{literal}b{/literal}c{php}d;s{/php}e{* hello's *}");
Expected result:
----------------
a{php}c{php}e{php}
Actual result:
--------------
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in
C:\Documents and Settings\john\Desktop\ttms desktop\php\index.php(17) :
regexp code on line 2
Fatal error: Failed evaluating code: '{php' . str_repeat(" ",
substr_count('{* hello''s *}', " ")) .'}' in C:\Documents and
Settings\john\Desktop\ttms desktop\php\index.php on line 17
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27299&edit=1