#42329 [Opn->Bgs]: preg_replace returns null
| From: | johannes@php.net | Date: | Fri, 17 Aug 2007 15:30:29 +0000 |
| Subject: | #42329 [Opn->Bgs]: preg_replace returns null | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116250@lists.php.net to get a copy of this message | ||
ID: 42329
Updated by: johannes@php.net
Reported By: grok at no-log dot org
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: Linux
PHP Version: 5.2.3
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Check preg_last_error().
Previous Comments:
------------------------------------------------------------------------
[2007-08-17 15:24:27] grok at no-log dot org
Description:
------------
preg_replace returns null instead of a string.
The input is an html file I was parsing.
The bug disapears when I change the file in many ways.
I managed to reduce the html file's size a bit, but it is still too
long to paste hear, and the posting might remove caracters that might be
involved in the bug.
I put the html file here: http://marcel.demosphere.fr/php-preg-bug.txt
Reproduce code:
---------------
var_dump(preg_replace('@^.*</head>@s','',file_get_contents("bug")));
Expected result:
----------------
preg_replace should return a string with all of the input.
Actual result:
--------------
preg_replace returns null
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42329&edit=1