Annotation of embedaddon/php/ext/standard/tests/array/sizeof_variation3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test sizeof() function : usage variations - checking for infinite recursion in COUNT_RECURSIVE mode
3: --FILE--
4: <?php
5: /* Prototype : int sizeof($mixed var[, int $mode])
6: * Description: Counts an elements in an array. If Standard PHP library is installed,
7: * it will return the properties of an object.
8: * Source code: ext/standard/basic_functions.c
9: * Alias to functions: count()
10: */
11:
12: echo "*** Testing sizeof() : usage variations ***\n";
13:
14: echo "-- Testing sizeof() for infinite recursion with arrays as argument in COUNT_RECURSIVE mode --\n";
15:
16: $array2 = array ( "Hi", "Hello",@$a);
17: $array3 = array( 'hi', 'hello');
18: $a = array ( 1, @$array1, $array2, $array3);
19: $array1 = array( array(1, 2), $a);
20: $array4 = array( 100, @$array4);
21:
22: var_dump( sizeof($array1, COUNT_RECURSIVE) );
23: echo "\n";
24: var_dump( sizeof($array4, COUNT_RECURSIVE) );
25:
26: echo "Done";
27: ?>
28: --EXPECTF--
29: *** Testing sizeof() : usage variations ***
30: -- Testing sizeof() for infinite recursion with arrays as argument in COUNT_RECURSIVE mode --
31: int(13)
32:
33: int(2)
34: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>