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_edit.phpt ('Test preg_match() function : basic functionality')

Script

1: <?php
2:
/* Prototype  : proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
3:  * Description: Perform a Perl-style regular expression match 
4:  * Source code: ext/pcre/php_pcre.c
5:  * Alias to functions: 
6: */
7:
8:
9:
$string 'Hello, world. [*], this is \ a string';
10:
11:
var_dump(preg_match('/^[hH]ello,\s/'$string$match1));                            //finds "Hello, "
12:
var_dump($match1);
13:
14:
var_dump(preg_match('/l^o,\s\w{5}/'$string$match2PREG_OFFSET_CAPTURE));                // tries to find "lo, world" at start of string
15:
var_dump($match2);
16:
17:
var_dump(preg_match('/\[\*\],\s(.*)/'$string$match3));                            //finds "[*], this is \ a string";
18:
var_dump($match3);
19:
20:
var_dump(preg_match('@\w{4}\s\w{2}\s\\\(?:\s.*)@'$string$match4PREG_OFFSET_CAPTURE14));    //finds "this is \ a string" (with non-capturing parentheses)
21:
var_dump($match4);
22:
23:
var_dump(preg_match('/hello world/'$string$match5));                            //tries to find "hello world" (should be Hello, world)
24:
var_dump($match5);
25:
?>
26:

27:

Report

==12118== Conditional jump or move depends on uninitialised value(s)
==12118==    at 0x4140CAC: ???
==12118==    by 0x14F2DE27: ???
==12118==    by 0x14F2DE27: ???
==12118==    by 0x14F2DE4C: ???
==12118==    by 0x1FFEFFBF5F: ???
==12118==    by 0xFFFFFFFF00000000: ???
==12118== 

 

Generated at Sun, 24 Sep 2017 15:32:56 +0000 (39 hours ago)

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