File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,9 @@ $xml = simplexml_load_string("<root></root>");
12
12
var_dump (isset ($ xml ->bla ->posts ));
13
13
$ xml ->bla ->posts [0 ]->name = "FooBar " ;
14
14
echo $ xml ->asXML ();
15
- $ xml = simplexml_load_string ("<root></root> " );
16
- $ xml ->bla ->posts []->name = "FooBar " ;
17
- echo $ xml ->asXML ();
18
15
?>
19
- --EXPECT--
20
- <? xml version="1.0 "?>
21
- <root><bla><posts><name>FooBar</name></posts></bla></root>
22
- bool(false)
23
- <? xml version="1.0 "?>
24
- <root><bla><posts><name>FooBar</name></posts></bla></root>
25
- <? xml version="1.0 "?>
26
- <root><bla><posts><name>FooBar</name></posts></bla></root>
16
+ --EXPECTF--
17
+ Fatal error: Uncaught Error: Attempt to assign property 'name' of non-object in %s:%d
18
+ Stack trace:
19
+ #0 {main}
20
+ thrown in %s on line %d
Original file line number Diff line number Diff line change @@ -13,6 +13,5 @@ $xml->movie[]->characters->character[0]->name = 'Miss Coder';
13
13
echo ($ xml ->asXml ());
14
14
15
15
?>
16
- --EXPECT--
17
- <? xml version="1.0 " standalone="yes"?>
18
- <collection><movie><characters><character><name>Miss Coder</name></character></characters></movie></collection>
16
+ --EXPECTF--
17
+ Fatal error: Cannot use [] for reading in %s on line %d
You can’t perform that action at this time.
0 commit comments