SimpleXML: A bug or just an annoyance?
| From: | Sebastian Bergmann | Date: | Mon, 13 Nov 2006 13:06:01 +0000 |
| Subject: | SimpleXML: A bug or just an annoyance? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-26539@lists.php.net to get a copy of this message | ||
1 <?php
2 $root = simplexml_load_string('<root
id="1"><node/></root>');
3
4 $array = array();
5 $array[$root['id']] = 'value';
6
7 $key = (int)$root['id'];
8 $array[$key] = 'value';
9 ?>
Warning: Illegal offset type in /home/sb/test.php on line 5
--
Sebastian Bergmann http://sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69