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_replace_callback_error1.phpt ('Test preg_replace_callback() function : error')

Script

1: <?php
2:
/*
3: * proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
4: * Function is implemented in ext/pcre/php_pcre.c
5: */
6:
error_reporting(E_ALL&~E_NOTICE);
7:
/*
8: * Testing how preg_replace_callback reacts to being passed the wrong type of regex argument
9: */
10:
echo "*** Testing preg_replace_callback() : error conditions ***\n";
11:
$regex_array = array('abcdef'//Regex without delimiters
12:
'/[a-zA-Z]'//Regex without closing delimiter
13:
'[a-zA-Z]/'//Regex without opening delimiter
14:
'/[a-zA-Z]/F', array('[a-z]'//Array of Regexes
15:
'[A-Z]''[0-9]'), '/[a-zA-Z]/'); //Regex string
16:
$replacement = array('zero''one''two''three''four''five''six''seven''eight''nine');
17: function 
integer_word($matches) {
18:     global 
$replacement;
19:     return 
$replacement[$matches[0]];
20: }
21:
$subject 'number 1.';
22: foreach(
$regex_array as $regex_value) {
23:     print 
"\nArg value is $regex_value\n";
24:     
var_dump(preg_replace_callback($regex_value'integer_word'$subject));
25: }
26:
?>
27:
===Done===
28:

Report

==29339== Conditional jump or move depends on uninitialised value(s)
==29339==    at 0x41310B4: ???
==29339==    by 0x14F2BFF7: ???
==29339==    by 0x14F2BFF7: ???
==29339==    by 0x14F2C000: ???
==29339==    by 0x1FFEFFBB6F: ???
==29339==    by 0x100000000: ???
==29339== 
==29339== Conditional jump or move depends on uninitialised value(s)
==29339==    at 0x4140D94: ???
==29339==    by 0x14F2BFF7: ???
==29339==    by 0x14F2BFF7: ???
==29339==    by 0x14F2C000: ???
==29339==    by 0x1FFEFFBB6F: ???
==29339==    by 0x100000000: ???
==29339== 
==29339== Conditional jump or move depends on uninitialised value(s)
==29339==    at 0x4140A84: ???
==29339==    by 0x14F2BFF7: ???
==29339==    by 0x14F2BFF7: ???
==29339==    by 0x14F2C000: ???
==29339==    by 0x1FFEFFBB6F: ???
==29339==    by 0x100000000: ???
==29339== 

 

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

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