/hphp/test/zend/good/ext/xml/tests/xml_parse_error.php
PHP | 25 lines | 12 code | 6 blank | 7 comment | 0 complexity | e11b8c30179414f40619773998a8fb89 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
- <?hh
- /* Prototype : proto int xml_parse(resource parser, string data [, int isFinal])
- * Description: Start parsing an XML document
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
- <<__EntryPoint>> function main(): void {
- echo "*** Testing xml_parse() : error conditions ***\n";
- //Test xml_parse with one more than the expected number of arguments
- echo "\n-- Testing xml_parse() function with more than expected no. of arguments --\n";
- $data = 'string_val';
- $isFinal = false;
- $extra_arg = 10;
- try { var_dump( xml_parse(null, $data, $isFinal, $extra_arg) ); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
- // Testing xml_parse with one less than the expected number of arguments
- echo "\n-- Testing xml_parse() function with less than expected no. of arguments --\n";
- try { var_dump( xml_parse(null) ); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
- echo "Done";
- }