From:             grok at no-log dot org
Operating system: Linux
PHP version:      5.2.3
PHP Bug Type:     PCRE related
Bug description:  preg_replace returns null

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 bug report at http://bugs.php.net/?id=42329&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42329&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42329&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42329&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42329&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42329&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42329&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42329&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42329&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42329&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42329&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42329&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42329&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42329&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42329&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42329&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42329&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42329&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42329&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42329&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42329&r=mysqlcfg

Reply via email to