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/xmlreader/tests/003.phpt ('XMLReader: libxml2 XML Reader, attributes test')

Script

1: <?php 
2:
/* $Id$ */
3:
$filename dirname(__FILE__) . '/_003.xml';
4:
5:
$xmlstring '<?xml version="1.0" encoding="UTF-8"?>
6: <books><book num="1" idx="2">book1</book></books>'
;
7:
file_put_contents($filename$xmlstring);
8:
9:
$reader = new XMLReader();
10: if (!
$reader->open($filename)) {
11:     exit();
12: }
13:
14:
// Only go through
15:
while ($reader->read()) {
16:     if (
$reader->nodeType != XMLREADER::END_ELEMENT) {
17:         if (
$reader->nodeType == XMLREADER::ELEMENT && $reader->hasAttributes) {
18:             
$attr $reader->moveToFirstAttribute();
19:             echo 
$reader->name ": ";
20:             echo 
$reader->value "\n";
21:
22:             if (
$reader->getAttribute($reader->name) == $reader->value) {
23:                 echo 
"1st attr (num) failed\n";
24:             }
25:
26:
27:             
$attr $reader->moveToNextAttribute();
28:             echo 
$reader->name ": ";
29:             echo 
$reader->value "\n";
30:
31:             if (
$reader->getAttribute($reader->name) == $reader->value) {
32:                 echo 
"2nd attr (idx) failed\n";
33:             }
34:
35:             
// Named attribute
36:             
$attr $reader->moveToAttribute('num');
37:             echo 
$reader->name ": ";
38:             echo 
$reader->value "\n";
39:
40:             if (
$reader->getAttribute('num') == $reader->value) {
41:                 echo 
"attr num failed\n";
42:             }
43:
44:             
$attr $reader->moveToAttribute('idx');
45:             echo 
$reader->name ": ";
46:             echo 
$reader->value "\n";
47:
48:             if (
$reader->getAttribute('idx') == $reader->value) {
49:                 echo 
"attr idx failed\n";
50:             }
51:
52:             
// Numeric positions of attributes
53:             
$attr $reader->moveToAttributeNo(0);
54:             echo 
$reader->name ": ";
55:             echo 
$reader->value "\n";
56:
57:             if (
$reader->getAttributeNo(0) == $reader->value) {
58:                 echo 
"attr 0 failed\n";
59:             }
60:
61:             
$attr $reader->moveToAttributeNo(1);
62:             echo 
$reader->name ": ";
63:             echo 
$reader->value "\n";
64:
65:         }
66:     }
67: }
68:
$reader->close();
69:
unlink($filename);
70:
?>
71:
===DONE===
72:

Report

==577== Conditional jump or move depends on uninitialised value(s)
==577==    at 0xF20786: zend_send_by_var_helper_SPEC_VAR (zend_vm_execute.h:13379)
==577==    by 0xF21D91: ZEND_SEND_VAR_SPEC_VAR_HANDLER (zend_vm_execute.h:13495)
==577==    by 0xED4ACA: execute_ex (zend_vm_execute.h:363)
==577==    by 0xED566D: zend_execute (zend_vm_execute.h:388)
==577==    by 0xE6A4DB: zend_execute_scripts (zend.c:1344)
==577==    by 0xD88C49: php_execute_script (main.c:2584)
==577==    by 0x101D0B6: do_cli (php_cli.c:994)
==577==    by 0x101E863: main (php_cli.c:1378)
==577== 
==577== Conditional jump or move depends on uninitialised value(s)
==577==    at 0xE6DC90: zend_parse_arg_impl (zend_API.c:443)
==577==    by 0xE6F3D4: zend_parse_arg (zend_API.c:691)
==577==    by 0xE70020: zend_parse_va_args (zend_API.c:873)
==577==    by 0xE704FD: zend_parse_parameters (zend_API.c:924)
==577==    by 0xCCBFE5: php_xmlreader_string_arg (php_xmlreader.c:420)
==577==    by 0xCCC8BD: zim_xmlreader_getAttribute (php_xmlreader.c:565)
==577==    by 0xED7044: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==577==    by 0xED856A: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:693)
==577==    by 0xED4ACA: execute_ex (zend_vm_execute.h:363)
==577==    by 0xED566D: zend_execute (zend_vm_execute.h:388)
==577==    by 0xE6A4DB: zend_execute_scripts (zend.c:1344)
==577==    by 0xD88C49: php_execute_script (main.c:2584)
==577== 

 

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

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