PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/pcre/tests/preg_match_basic.phpt ('Test preg_match() function : basic functionality')

Script

1: <?php
2:
/* 
3:  *  proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
4:  * Function is implemented in ext/pcre/php_pcre.c
5: */
6:
$string 'Hello, world. [*], this is \ a string';
7:
var_dump(preg_match('/^[hH]ello,\s/'$string$match1)); //finds "Hello, "
8:
var_dump($match1);
9:
var_dump(preg_match('/l^o,\s\w{5}/'$string$match2PREG_OFFSET_CAPTURE)); // tries to find "lo, world" at start of string
10:
var_dump($match2);
11:
var_dump(preg_match('/\[\*\],\s(.*)/'$string$match3)); //finds "[*], this is \ a string";
12:
var_dump($match3);
13:
var_dump(preg_match('@\w{4}\s\w{2}\s\\\(?:\s.*)@'$string$match4PREG_OFFSET_CAPTURE14)); //finds "this is \ a string" (with non-capturing parentheses)
14:
var_dump($match4);
15:
var_dump(preg_match('/hello world/'$string$match5)); //tries to find "hello world" (should be Hello, world)
16:
var_dump($match5);
17:
?>
18:

19:

Report

==29275== Conditional jump or move depends on uninitialised value(s)
==29275==    at 0x4140CAC: ???
==29275==    by 0x14F2B307: ???
==29275==    by 0x14F2B307: ???
==29275==    by 0x14F2B32C: ???
==29275==    by 0x1FFEFFBFBF: ???
==29275==    by 0x10AC63B: zend_is_executing (zend_execute_API.c:525)
==29275== 

 

Generated at Sat, 09 Sep 2017 03:10:54 +0000 (14 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.