Annotation of embedaddon/php/ext/simplexml/tests/bug37565.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #37565 (Using reflection::export with simplexml causing a crash)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("simplexml") || !extension_loaded('reflection')) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: function my_error_handler($errno, $errstr, $errfile, $errline) {
! 9: echo "Error: $errstr\n";
! 10: }
! 11:
! 12: set_error_handler('my_error_handler');
! 13:
! 14: class Setting extends ReflectionObject
! 15: {
! 16: }
! 17:
! 18: Reflection::export(simplexml_load_string('<test/>', 'Setting'));
! 19:
! 20: Reflection::export(simplexml_load_file('data:,<test/>', 'Setting'));
! 21:
! 22: ?>
! 23: ===DONE===
! 24: --EXPECTF--
! 25: Error: simplexml_load_string() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given
! 26: Error: Argument 1 passed to Reflection::export() must implement interface Reflector, null given
! 27: Error: Reflection::export() expects parameter 1 to be Reflector, null given
! 28: Error: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given
! 29: Error: Argument 1 passed to Reflection::export() must implement interface Reflector, null given
! 30: Error: Reflection::export() expects parameter 1 to be Reflector, null given
! 31: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>