We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for ... in can't work with SimpleXMLElement?
My XML is :
<?xml version="1.0" encoding="UTF-8"?> -- | <Messages xmlns="http://mns.aliyuncs.com/doc/v1"> | <Message> | <MessageId>52224710247175BA-1-15F72355F38-200000004</MessageId> | <MessageBodyMD5>D23B14C6CD9CA410B627D3C3C38BED34</MessageBodyMD5> | <MessageBody>["asdf","sadfasdf","2017-10-31 11:33:39"]</MessageBody> | <ReceiptHandle>1-ODU4OTkzNDU5Ni0xNTA5NjE0MzA5LTEtOA==</ReceiptHandle> | <EnqueueTime>1509449621304</EnqueueTime> | <FirstDequeueTime>1509608944846</FirstDequeueTime> | <NextVisibleTime>1509614309000</NextVisibleTime> | <DequeueCount>20</DequeueCount> | <Priority>8</Priority> | </Message> | <Message> | <MessageId>52224710247175BA-1-15F72358F0A-200000005</MessageId> | <MessageBodyMD5>0DC582A80C06D1C334899B104FFFDA5D</MessageBodyMD5> | <MessageBody>["asdf","sadfasdf","2017-10-31 11:33:51"]</MessageBody> | <ReceiptHandle>1-ODU4OTkzNDU5Ny0xNTA5NjE0MzA5LTEtOA==</ReceiptHandle> | <EnqueueTime>1509449633546</EnqueueTime> | <FirstDequeueTime>1509608952453</FirstDequeueTime> | <NextVisibleTime>1509614309000</NextVisibleTime> | <DequeueCount>17</DequeueCount> | <Priority>8</Priority> | </Message> | <Message> | <MessageId>52224710247175BA-1-15F7235936E-200000006</MessageId> | <MessageBodyMD5>C0CEFB762CE46988EDE0A0DF34243519</MessageBodyMD5> | <MessageBody>["asdf","sadfasdf","2017-10-31 11:33:52"]</MessageBody> | <ReceiptHandle>1-ODU4OTkzNDU5OC0xNTA5NjE0MzA5LTEtOA==</ReceiptHandle> | <EnqueueTime>1509449634670</EnqueueTime> | <FirstDequeueTime>1509608954367</FirstDequeueTime> | <NextVisibleTime>1509614309000</NextVisibleTime> | <DequeueCount>16</DequeueCount> | <Priority>8</Priority> | </Message> | <Message> | <MessageId>52224710247175BA-1-15F7235978C-200000007</MessageId> | <MessageBodyMD5>BE399129E2EA269C68EAAE815BE718AD</MessageBodyMD5> | <MessageBody>["asdf","sadfasdf","2017-10-31 11:33:53"]</MessageBody> | <ReceiptHandle>1-ODU4OTkzNDU5OS0xNTA5NjE0MzA5LTEtOA==</ReceiptHandle> | <EnqueueTime>1509449635724</EnqueueTime> | <FirstDequeueTime>1509608954799</FirstDequeueTime> | <NextVisibleTime>1509614309000</NextVisibleTime> | <DequeueCount>13</DequeueCount> | <Priority>8</Priority> | </Message> | </Messages>
when i use zephir language , the code is:
// zephir language code ..... var xml = simplexml_load_string(xmlstring); var k, v; for v, v in xml { print_r(k); print_r(v); } ....
the run time error is:
<b>Fatal error</b>: Uncaught Exception: The argument is not initialized or iterable() in Test.zep:154
but It's work very good in PHP code
<?php ... $xml = simplexml_load_string($xmlstring); foreach ($xml as $item) { print_r($item); } ...
The text was updated successfully, but these errors were encountered:
Fixed in the development branch. Feel free to open a new issue if the problem appears again. Thank you for contributing.
development
Sorry, something went wrong.
No branches or pull requests
for ... in can't work with SimpleXMLElement?
My XML is :
when i use zephir language , the code is:
the run time error is:
but It's work very good in PHP code
The text was updated successfully, but these errors were encountered: