Annotation of embedaddon/php/ext/com_dotnet/tests/27974.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: COM: mapping a safearray
! 3: --SKIPIF--
! 4: <?php # vim:ft=php
! 5: if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
! 6: --FILE--
! 7: <?php // $Id: 27974.phpt 206395 2006-02-04 10:57:28Z rrichards $
! 8: error_reporting(E_ALL);
! 9:
! 10: try {
! 11: $v = new VARIANT(array("123", "456", "789"));
! 12: var_dump($v);
! 13: print $v[0] . "\n";
! 14: print $v[1] . "\n";
! 15: print $v[2] . "\n";
! 16: $v[1] = "hello";
! 17: foreach ($v as $item) {
! 18: var_dump($item);
! 19: }
! 20: try {
! 21: $v[3] = "shouldn't work";
! 22: } catch (com_exception $e) {
! 23: if ($e->getCode() != DISP_E_BADINDEX) {
! 24: throw $e;
! 25: }
! 26: echo "Got BADINDEX exception OK!\n";
! 27: }
! 28: echo "OK!";
! 29: } catch (Exception $e) {
! 30: print $e;
! 31: }
! 32: ?>
! 33: --EXPECT--
! 34: object(variant)#1 (0) {
! 35: }
! 36: 123
! 37: 456
! 38: 789
! 39: string(3) "123"
! 40: string(5) "hello"
! 41: string(3) "789"
! 42: Got BADINDEX exception OK!
! 43: OK!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>