1--TEST--
2Test ResourceBundle array access and count - existing/missing keys
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5--FILE--
6<?php
7	include "resourcebundle.inc";
8
9	// fall back
10	$r = new ResourceBundle( 'en_US', BUNDLE );
11
12	printf( "length: %d\n", count($r) );
13	printf( "teststring: %s\n", $r['teststring'] );
14	printf( "testint: %d\n", $r['testint'] );
15
16	print_r( $r['testvector'] );
17
18	printf( "testbin: %s\n", bin2hex($r['testbin']) );
19
20	$r2 = $r['testtable'];
21	printf( "testtable: %d\n", $r2['major'] );
22
23	$r2 = $r['testarray'];
24	printf( "testarray: %s\n", $r2[2] );
25
26	$t = $r['nonexisting'];
27	echo debug( $t );
28?>
29--EXPECT--
30length: 6
31teststring: Hello World!
32testint: 2
33Array
34(
35    [0] => 1
36    [1] => 2
37    [2] => 3
38    [3] => 4
39    [4] => 5
40    [5] => 6
41    [6] => 7
42    [7] => 8
43    [8] => 9
44    [9] => 0
45)
46testbin: a1b2c3d4e5f67890
47testtable: 3
48testarray: string 3
49NULL
50    2: Cannot load resource element 'nonexisting': U_MISSING_RESOURCE_ERROR
51