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

==32371== Conditional jump or move depends on uninitialised value(s)
==32371==    at 0xF0E335: zend_send_by_var_helper_SPEC_VAR (zend_vm_execute.h:13373)
==32371==    by 0xF0F940: ZEND_SEND_VAR_SPEC_VAR_HANDLER (zend_vm_execute.h:13489)
==32371==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==32371==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==32371==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==32371==    by 0xD79282: php_execute_script (main.c:2549)
==32371==    by 0x100ACEE: do_cli (php_cli.c:994)
==32371==    by 0x100C49B: main (php_cli.c:1378)
==32371== 
==32371== Conditional jump or move depends on uninitialised value(s)
==32371==    at 0xE5BC34: zend_parse_arg_impl (zend_API.c:443)
==32371==    by 0xE5D378: zend_parse_arg (zend_API.c:691)
==32371==    by 0xE5DFC4: zend_parse_va_args (zend_API.c:873)
==32371==    by 0xE5E4A1: zend_parse_parameters (zend_API.c:924)
==32371==    by 0xCBC99D: php_xmlreader_string_arg (php_xmlreader.c:420)
==32371==    by 0xCBD275: zim_xmlreader_getAttribute (php_xmlreader.c:565)
==32371==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32371==    by 0xEC61DF: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:693)
==32371==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==32371==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==32371==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==32371==    by 0xD79282: php_execute_script (main.c:2549)
==32371== 

 

Generated at Tue, 22 Jul 2014 01:33:26 +0000 (10 days ago)

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