#45828 [Opn]: preg_match_all result not correct

[email protected] ("chenjii at gmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               45828
 User updated by:  chenjii at gmail dot com
 Reported By:      chenjii at gmail dot com
 Status:           Open
 Bug Type:         PCRE related
 Operating System: windows xp SP2
 PHP Version:      5.2.6
 New Comment:

Oh , Date is 2008-08-15 not 2008-05-15


Previous Comments:
------------------------------------------------------------------------

[2008-08-15 03:47:14] chenjii at gmail dot com

Description:
------------
preg_match_all's result is correct before windows update !

But yesterday (2008-05-15) I update my windows xp by windows's Auto
Update , preg_match_all's result became not correct!


my OS: windows XP SP2 (Traditional Chinese)
php: 5.2.6 in windows

PCRE Library Version 	7.6 2008-01-28 

Reproduce code:
---------------
$array_matches = array();

$sql = 'SELECT b.* , u.account , u.name , u2.account as account2 ,
u2.name as name2 FROM bbss as b LEFT JOIN users as u on (u.uid =
b.post_uid) LEFT JOIN users as u2 on (u2.uid = b.modified_uid) WHERE
deleted = 0 AND view_start_time <= NOW() ORDER BY bid DESC LIMIT 0 ,
20';

$match_count = preg_match_all('/^(SELECT.*?)LIMIT/im', $sql,
$array_matches);


Expected result:
----------------
$match_count > 0;

$array_matches == 
Array(
  [0] => Array ( 'SELECT b.* , u.account , u.name , u2.account as
account2 , u2.name as name2 FROM bbss as b LEFT JOIN users as u on
(u.uid = b.post_uid) LEFT JOIN users as u2 on (u2.uid = b.modified_uid)
WHERE deleted = 0 AND view_start_time <= NOW() ORDER BY bid DESC LIMIT 0
, 20' ) 
  [1] => Array ( 'SELECT b.* , u.account , u.name , u2.account as
account2 , u2.name as name2 FROM bbss as b LEFT JOIN users as u on
(u.uid = b.post_uid) LEFT JOIN users as u2 on (u2.uid = b.modified_uid)
WHERE deleted = 0 AND view_start_time <= NOW() ORDER BY bid DESC ' )
)

Actual result:
--------------
$match_count == 0

$array_matches == Array ( [0] => Array ( ) [1] => Array ( ) )


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45828&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.