PHP  
 PHP_HEAD
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

==11784== Conditional jump or move depends on uninitialised value(s)
==11784==    at 0x91268B: fetch_token (regparse.c:3147)
==11784==    by 0x91BB8C: parse_regexp (regparse.c:5514)
==11784==    by 0x91BD21: onig_parse_make_tree (regparse.c:5543)
==11784==    by 0x8F640D: onig_compile (regcomp.c:5300)
==11784==    by 0x8F6FDA: onig_new (regcomp.c:5545)
==11784==    by 0x98CB0F: php_mbregex_compile_pattern (php_mbregex.c:456)
==11784==    by 0x98E610: _php_mb_regex_ereg_replace_exec (php_mbregex.c:869)
==11784==    by 0x99143D: zif_mb_ereg_replace (php_mbregex.c:1030)
==11784==    by 0x10A35DE: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:565)
==11784==    by 0x10A0F71: execute_ex (zend_vm_execute.h:352)
==11784==    by 0x10A1B62: zend_execute (zend_vm_execute.h:381)
==11784==    by 0xFF7FFD: zend_execute_scripts (zend.c:1266)
==11784== 
==11784== Conditional jump or move depends on uninitialised value(s)
==11784==    at 0x91457A: fetch_token (regparse.c:3593)
==11784==    by 0x91BB8C: parse_regexp (regparse.c:5514)
==11784==    by 0x91BD21: onig_parse_make_tree (regparse.c:5543)
==11784==    by 0x8F640D: onig_compile (regcomp.c:5300)
==11784==    by 0x8F6FDA: onig_new (regcomp.c:5545)
==11784==    by 0x98CB0F: php_mbregex_compile_pattern (php_mbregex.c:456)
==11784==    by 0x98E610: _php_mb_regex_ereg_replace_exec (php_mbregex.c:869)
==11784==    by 0x99143D: zif_mb_ereg_replace (php_mbregex.c:1030)
==11784==    by 0x10A35DE: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:565)
==11784==    by 0x10A0F71: execute_ex (zend_vm_execute.h:352)
==11784==    by 0x10A1B62: zend_execute (zend_vm_execute.h:381)
==11784==    by 0xFF7FFD: zend_execute_scripts (zend.c:1266)
==11784== 
==11784== Conditional jump or move depends on uninitialised value(s)
==11784==    at 0x914638: fetch_token (regparse.c:3610)
==11784==    by 0x91BB8C: parse_regexp (regparse.c:5514)
==11784==    by 0x91BD21: onig_parse_make_tree (regparse.c:5543)
==11784==    by 0x8F640D: onig_compile (regcomp.c:5300)
==11784==    by 0x8F6FDA: onig_new (regcomp.c:5545)
==11784==    by 0x98CB0F: php_mbregex_compile_pattern (php_mbregex.c:456)
==11784==    by 0x98E610: _php_mb_regex_ereg_replace_exec (php_mbregex.c:869)
==11784==    by 0x99143D: zif_mb_ereg_replace (php_mbregex.c:1030)
==11784==    by 0x10A35DE: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:565)
==11784==    by 0x10A0F71: execute_ex (zend_vm_execute.h:352)
==11784==    by 0x10A1B62: zend_execute (zend_vm_execute.h:381)
==11784==    by 0xFF7FFD: zend_execute_scripts (zend.c:1266)
==11784== 
==11784== Use of uninitialised value of size 8
==11784==    at 0x8F1987: set_bm_skip (regcomp.c:3912)
==11784==    by 0x8F57F4: set_optimize_exact_info (regcomp.c:4906)
==11784==    by 0x8F5C94: set_optimize_info_from_tree (regcomp.c:4990)
==11784==    by 0x8F6928: onig_compile (regcomp.c:5381)
==11784==    by 0x8F6FDA: onig_new (regcomp.c:5545)
==11784==    by 0x98CB0F: php_mbregex_compile_pattern (php_mbregex.c:456)
==11784==    by 0x98E610: _php_mb_regex_ereg_replace_exec (php_mbregex.c:869)
==11784==    by 0x99143D: zif_mb_ereg_replace (php_mbregex.c:1030)
==11784==    by 0x10A35DE: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:565)
==11784==    by 0x10A0F71: execute_ex (zend_vm_execute.h:352)
==11784==    by 0x10A1B62: zend_execute (zend_vm_execute.h:381)
==11784==    by 0xFF7FFD: zend_execute_scripts (zend.c:1266)
==11784== 
==11784== Conditional jump or move depends on uninitialised value(s)
==11784==    at 0x9059E9: bm_search (regexec.c:2947)
==11784==    by 0x906514: forward_search_range (regexec.c:3146)
==11784==    by 0x907CAA: onig_search (regexec.c:3599)
==11784==    by 0x98E802: _php_mb_regex_ereg_replace_exec (php_mbregex.c:895)
==11784==    by 0x99143D: zif_mb_ereg_replace (php_mbregex.c:1030)
==11784==    by 0x10A35DE: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:565)
==11784==    by 0x10A0F71: execute_ex (zend_vm_execute.h:352)
==11784==    by 0x10A1B62: zend_execute (zend_vm_execute.h:381)
==11784==    by 0xFF7FFD: zend_execute_scripts (zend.c:1266)
==11784==    by 0xEFAF93: php_execute_script (main.c:2560)
==11784==    by 0x121FD91: do_cli (php_cli.c:978)
==11784==    by 0x1221808: main (php_cli.c:1356)
==11784== 

 

Generated at Wed, 22 Oct 2014 07:25:05 +0000 (14 hours ago)

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