1--TEST--
2Test 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
12echo "*** Testing sizeof() : usage variations ***\n";
13
14echo "-- 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
22var_dump( sizeof($array1, COUNT_RECURSIVE) );
23echo "\n";
24var_dump( sizeof($array4, COUNT_RECURSIVE) );
25
26echo "Done";
27?>
28--EXPECT--
29*** Testing sizeof() : usage variations ***
30-- Testing sizeof() for infinite recursion with arrays as argument in COUNT_RECURSIVE mode --
31int(13)
32
33int(2)
34Done
35