PageRenderTime 43ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/good/ext/xml/tests/xml_parse_into_struct_variation.php

http://github.com/facebook/hiphop-php
PHP | 23 lines | 15 code | 3 blank | 5 comment | 0 complexity | 9bb93f0ef421c976f9272d0ca3702e06 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?hh
  2. /* Prototype : proto int xml_parse_into_struct(resource parser, string data, inout array struct, inout array index)
  3. * Description: Parsing a XML document
  4. * Source code: ext/xml/xml.c
  5. * Alias to functions:
  6. */
  7. <<__EntryPoint>> function main(): void {
  8. echo "*** Testing xml_parse_into_struct() : variation ***\n";
  9. $simple = "<main><para><note>simple note</note></para><para><note>simple note</note></para></main>";
  10. $p = xml_parser_create();
  11. $vals = varray[];
  12. $index = varray[];
  13. xml_parse_into_struct($p, $simple, inout $vals, inout $index);
  14. xml_parser_free($p);
  15. echo "Index array\n";
  16. print_r($index);
  17. echo "\nVals array\n";
  18. print_r($vals);
  19. echo "Done";
  20. }