1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 19:14:16 +02:00
Files
archived-php-src/ext/simplexml/tests/bug37565.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

34 lines
952 B
PHP

--TEST--
Bug #37565 (Using reflection::export with simplexml causing a crash)
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
function my_error_handler($errno, $errstr, $errfile, $errline) {
echo "Error: $errstr\n";
}
set_error_handler('my_error_handler');
class Setting extends ReflectionObject
{
}
try {
Reflection::export(simplexml_load_string('<test/>', 'Setting'));
} catch (Error $e) {
my_error_handler($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
}
try {
Reflection::export(simplexml_load_file('data:,<test/>', 'Setting'));
} catch (Error $e) {
my_error_handler($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
}
?>
--EXPECT--
Error: simplexml_load_string() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given
Error: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given