xref: /PHP-8.3/ext/simplexml/tests/bug67572.phpt (revision 7f2f0c00)
1--TEST--
2Bug #67572 - SimpleXMLElement not parsing \n correctly
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7$foo = 'bar';
8print "regular string ... ";
9var_dump(empty($foo));
10
11$xml = simplexml_load_string("<xml><something>somevalue</something></xml>");
12$xml2 = simplexml_load_string("<xml>\n<something>somevalue</something>\n</xml>");
13
14foreach($xml as $key => $value) {
15    print "$key = $value ... ";
16    var_dump(empty($value));
17    var_dump($value == false);
18}
19
20foreach($xml2 as $key => $value) {
21    print "$key = $value ... ";
22    var_dump(empty($value));
23    var_dump($value == false);
24}
25?>
26--EXPECT--
27regular string ... bool(false)
28something = somevalue ... bool(false)
29bool(false)
30something = somevalue ... bool(false)
31bool(false)
32