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

Valgrind Report for ext/mbstring/tests/mb_ereg_replace_variation1.phpt ('Test mb_ereg_replace() function : usage variations - <type here specifics of this variation>')

Script

1: <?php
2:
/* Prototype  : proto string mb_ereg_replace(string pattern, string replacement, string string [, string option])
3:  * Description: Replace regular expression for multibyte string 
4:  * Source code: ext/mbstring/php_mbregex.c
5:  * Alias to functions: 
6:  */
7:
8:
echo "*** Testing mb_ereg_replace() : usage variations ***\n";
9:
10:
// Initialise function arguments not being substituted (if any)
11:
$replacement 'string_val';
12:
$string 'string_val';
13:
$option '';
14:
15:
//get an unset variable
16:
$unset_var 10;
17: unset (
$unset_var);
18:
19:
// get a class
20:
class classA
21:
{
22:   public function 
__toString() {
23:     return 
"UTF-8";
24:   }
25: }
26:
27:
// heredoc string
28:
$heredoc = <<<EOT
29:
UTF-8
30:
EOT;
31:
32:
// unexpected values to be passed to $encoding argument
33:
$inputs = array(
34:
35:        
// int data
36: /*1*/  
0,
37:        
1,
38:        
12345,
39:        -
2345,
40:
41:        
// float data
42: /*5*/  
10.5,
43:        -
10.5,
44:        
12.3456789000e10,
45:        
12.3456789000E-10,
46:        
.5,
47:
48:        
// null data
49: /*10*/ 
NULL,
50:        
null,
51:
52:        
// boolean data
53: /*12*/ 
true,
54:        
false,
55:        
TRUE,
56:        
FALSE,
57:        
58:        
// empty data
59: /*16*/ 
"",
60:        
'',
61:
62:        
// string data
63: /*18*/ 
"UTF-8",
64:        
'UTF-8',
65:        
$heredoc,
66:        
67:        
// object data
68: /*21*/ 
new classA(),
69:
70:        
// undefined data
71: /*22*/ 
@$undefined_var,
72:
73:        
// unset data
74: /*23*/ 
@$unset_var,
75:
76: );
77:
78:
// loop through each element of the array for pattern
79:
80:
$iterator 1;
81: foreach(
$inputs as $input) {
82:       echo 
"\n-- Iteration $iterator --\n";
83:       
var_dumpmb_ereg_replace($input$replacement$string$option) );
84:       
$iterator++;
85: };
86:
87: echo 
"Done";
88:
?>
89:

Report

==19398== Conditional jump or move depends on uninitialised value(s)
==19398==    at 0x89A9AF: fetch_token (regparse.c:3147)
==19398==    by 0x8A3EB0: parse_regexp (regparse.c:5514)
==19398==    by 0x8A4045: onig_parse_make_tree (regparse.c:5543)
==19398==    by 0x87E731: onig_compile (regcomp.c:5300)
==19398==    by 0x87F2FE: onig_new (regcomp.c:5545)
==19398==    by 0x90FF1B: php_mbregex_compile_pattern (php_mbregex.c:458)
==19398==    by 0x911B69: _php_mb_regex_ereg_replace_exec (php_mbregex.c:870)
==19398==    by 0x9138A8: zif_mb_ereg_replace (php_mbregex.c:1029)
==19398==    by 0xED7044: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==19398==    by 0xEE2B45: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==19398==    by 0xED4ACA: execute_ex (zend_vm_execute.h:363)
==19398==    by 0xED566D: zend_execute (zend_vm_execute.h:388)
==19398== 
==19398== Conditional jump or move depends on uninitialised value(s)
==19398==    at 0x89C89E: fetch_token (regparse.c:3593)
==19398==    by 0x8A3EB0: parse_regexp (regparse.c:5514)
==19398==    by 0x8A4045: onig_parse_make_tree (regparse.c:5543)
==19398==    by 0x87E731: onig_compile (regcomp.c:5300)
==19398==    by 0x87F2FE: onig_new (regcomp.c:5545)
==19398==    by 0x90FF1B: php_mbregex_compile_pattern (php_mbregex.c:458)
==19398==    by 0x911B69: _php_mb_regex_ereg_replace_exec (php_mbregex.c:870)
==19398==    by 0x9138A8: zif_mb_ereg_replace (php_mbregex.c:1029)
==19398==    by 0xED7044: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==19398==    by 0xEE2B45: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==19398==    by 0xED4ACA: execute_ex (zend_vm_execute.h:363)
==19398==    by 0xED566D: zend_execute (zend_vm_execute.h:388)
==19398== 
==19398== Conditional jump or move depends on uninitialised value(s)
==19398==    at 0x89C95C: fetch_token (regparse.c:3610)
==19398==    by 0x8A3EB0: parse_regexp (regparse.c:5514)
==19398==    by 0x8A4045: onig_parse_make_tree (regparse.c:5543)
==19398==    by 0x87E731: onig_compile (regcomp.c:5300)
==19398==    by 0x87F2FE: onig_new (regcomp.c:5545)
==19398==    by 0x90FF1B: php_mbregex_compile_pattern (php_mbregex.c:458)
==19398==    by 0x911B69: _php_mb_regex_ereg_replace_exec (php_mbregex.c:870)
==19398==    by 0x9138A8: zif_mb_ereg_replace (php_mbregex.c:1029)
==19398==    by 0xED7044: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==19398==    by 0xEE2B45: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==19398==    by 0xED4ACA: execute_ex (zend_vm_execute.h:363)
==19398==    by 0xED566D: zend_execute (zend_vm_execute.h:388)
==19398== 
==19398== Use of uninitialised value of size 8
==19398==    at 0x879CAB: set_bm_skip (regcomp.c:3912)
==19398==    by 0x87DB18: set_optimize_exact_info (regcomp.c:4906)
==19398==    by 0x87DFB8: set_optimize_info_from_tree (regcomp.c:4990)
==19398==    by 0x87EC4C: onig_compile (regcomp.c:5381)
==19398==    by 0x87F2FE: onig_new (regcomp.c:5545)
==19398==    by 0x90FF1B: php_mbregex_compile_pattern (php_mbregex.c:458)
==19398==    by 0x911B69: _php_mb_regex_ereg_replace_exec (php_mbregex.c:870)
==19398==    by 0x9138A8: zif_mb_ereg_replace (php_mbregex.c:1029)
==19398==    by 0xED7044: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==19398==    by 0xEE2B45: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==19398==    by 0xED4ACA: execute_ex (zend_vm_execute.h:363)
==19398==    by 0xED566D: zend_execute (zend_vm_execute.h:388)
==19398== 
==19398== Conditional jump or move depends on uninitialised value(s)
==19398==    at 0x88DD0D: bm_search (regexec.c:2947)
==19398==    by 0x88E838: forward_search_range (regexec.c:3146)
==19398==    by 0x88FFCE: onig_search (regexec.c:3599)
==19398==    by 0x911D8C: _php_mb_regex_ereg_replace_exec (php_mbregex.c:896)
==19398==    by 0x9138A8: zif_mb_ereg_replace (php_mbregex.c:1029)
==19398==    by 0xED7044: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==19398==    by 0xEE2B45: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==19398==    by 0xED4ACA: execute_ex (zend_vm_execute.h:363)
==19398==    by 0xED566D: zend_execute (zend_vm_execute.h:388)
==19398==    by 0xE6A4DB: zend_execute_scripts (zend.c:1344)
==19398==    by 0xD88C49: php_execute_script (main.c:2584)
==19398==    by 0x101D0B6: do_cli (php_cli.c:994)
==19398== 

 

Generated at Wed, 10 Dec 2014 19:30:08 +0000 (7 days ago)

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