note 81704 added to function.xml-parse-into-struct
| From: | mathiasrav at gmail dot com | Date: | Mon, 10 Mar 2008 16:42:58 +0000 |
| Subject: | note 81704 added to function.xml-parse-into-struct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136904@lists.php.net to get a copy of this message | ||
In response to Anonymous' post at 26-Feb-2008 11:50:
Saying that you "don't understand everything" isn't going to get you very
popular - you should understand the code you use.
foreach isn't *slow* in PHP, it is actually faster than the equivalent for-construct (which, in
many cases, isn't available).
The reason your script is slow is simply your use of xml_parse_into_struct - it reads the whole
XML-string and doesn't return until it has parsed and validated it all. If you're looking
for efficiency, you'll have to use the more low-level xml_parser_create, xml_set_*_handler
functions. Then make sure you don't keep everything in a huge array before outputting it (at
least don't if you're going for efficiency).
----
Server IP: 87.54.44.10
Probable Submitter: 87.58.61.162
----
Manual Page -- http://www.php.net/manual/en/function.xml-parse-into-struct.php
Edit -- https://master.php.net/note/edit/81704
Del: integrated -- https://master.php.net/note/delete/81704/integrated
Del: useless -- https://master.php.net/note/delete/81704/useless
Del: bad code -- https://master.php.net/note/delete/81704/bad+code
Del: spam -- https://master.php.net/note/delete/81704/spam
Del: non-english -- https://master.php.net/note/delete/81704/non-english
Del: in docs -- https://master.php.net/note/delete/81704/in+docs
Del: other reasons-- https://master.php.net/note/delete/81704
Reject -- https://master.php.net/note/reject/81704
Search -- https://master.php.net/manage/user-notes.php