File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #61335 - Access to array node returns wrong truth value
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ("simplexml " )) die ("skip SimpleXML not available " );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ rec1 = simplexml_load_string ("<foo><bar>aa</bar> \n</foo> " );
10
+ $ rec2 = simplexml_load_string ("<foo><bar>aa</bar></foo> " );
11
+
12
+ if ($ rec1 ->bar [0 ]) echo "NONEMPTY1 \n" ;
13
+ if ($ rec1 ->bar [0 ] . "" ) echo "NONEMPTY2 \n" ;
14
+ if ($ rec2 ->bar [0 ]) echo "NONEMPTY3 \n" ;
15
+ ?>
16
+ --EXPECT--
17
+ NONEMPTY1
18
+ NONEMPTY2
19
+ NONEMPTY3
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #67572 - SimpleXMLElement not parsing \n correctly
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ("simplexml " )) die ("skip SimpleXML not available " );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ foo = 'bar ' ;
10
+ print "regular string ... " ;
11
+ var_dump (empty ($ foo ));
12
+
13
+ $ xml = simplexml_load_string ("<xml><something>somevalue</something></xml> " );
14
+ $ xml2 = simplexml_load_string ("<xml> \n<something>somevalue</something> \n</xml> " );
15
+
16
+ foreach ($ xml as $ key => $ value ) {
17
+ print "$ key = $ value ... " ;
18
+ var_dump (empty ($ value ));
19
+ var_dump ($ value == false );
20
+ }
21
+
22
+ foreach ($ xml2 as $ key => $ value ) {
23
+ print "$ key = $ value ... " ;
24
+ var_dump (empty ($ value ));
25
+ var_dump ($ value == false );
26
+ }
27
+ ?>
28
+ --EXPECT--
29
+ regular string ... bool(false)
30
+ something = somevalue ... bool(false)
31
+ bool(false)
32
+ something = somevalue ... bool(false)
33
+ bool(false)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #68946 - simplexml_load_string() result depends on formatting of xml string
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ("simplexml " )) die ("skip SimpleXML not available " );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ sxe = simplexml_load_string ("<?BrightCloud version=bcap/1.1?><bcap><seqnum>1</seqnum></bcap> " );
10
+ var_dump ($ sxe == false );
11
+ $ sxe = simplexml_load_string ("<?BrightCloud version=bcap/1.1?><bcap> <seqnum>1</seqnum></bcap> " );
12
+ var_dump ($ sxe == false );
13
+ ?>
14
+ --EXPECT--
15
+ bool(false)
16
+ bool(false)
You can’t perform that action at this time.
0 commit comments