1--TEST--
2Test count() function : basic functionality
3--FILE--
4<?php
5/*
6 * Test basic functionality of count() using an array as $var argument
7 * and different values as $mode argument.
8 */
9
10echo "*** Testing count() : basic functionality ***\n";
11
12echo "\n-- One Dimensional Array: --\n";
13$array = array('zero', 'one', 'two');
14var_dump(count($array));
15
16echo "\n-- Two Dimensional Array: --\n";
17$array_multi = array('zero', array(1, 2, 3), 'two');
18echo "\$mode = COUNT_NORMAL:    ";
19var_dump(count($array_multi, COUNT_NORMAL));
20echo "\$mode = 0:               ";
21var_dump(count($array_multi, 0));
22echo "\$mode = COUNT_RECURSIVE: ";
23var_dump(count($array_multi, COUNT_RECURSIVE));
24echo "\$mode = 1:               ";
25var_dump(count($array_multi, 1));
26
27echo "Done";
28?>
29--EXPECT--
30*** Testing count() : basic functionality ***
31
32-- One Dimensional Array: --
33int(3)
34
35-- Two Dimensional Array: --
36$mode = COUNT_NORMAL:    int(3)
37$mode = 0:               int(3)
38$mode = COUNT_RECURSIVE: int(6)
39$mode = 1:               int(6)
40Done
41