Annotation of embedaddon/php/ext/standard/tests/array/array_count_values_variation.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
1.1.1.2 ! misho       2: Test array_count_values() function : Test all normal parameter variations 
1.1       misho       3: --FILE--
                      4: <?php
                      5: /* Prototype  : proto array array_count_values(array input)
                      6:  * Description: Return the value as key and the frequency of that value in input as value 
                      7:  * Source code: ext/standard/array.c
                      8:  * Alias to functions: 
                      9:  */
                     10: 
                     11: /*
1.1.1.2 ! misho      12:  * Test behaviour with parameter variations
1.1       misho      13:  */
                     14: 
                     15: echo "*** Testing array_count_values() : parameter variations ***\n";
                     16: 
                     17: class A {
                     18:        static function hello() {
                     19:          echo "Hello\n";
                     20:        }
                     21: }
                     22: 
                     23: $ob = new A();
                     24: 
                     25: $fp = fopen("array_count_file", "w+");
                     26: 
                     27: $arrays = array ("bobk" => "bobv", "val", 6 => "val6",  $fp, $ob);
                     28: 
                     29: var_dump (@array_count_values ($arrays));
                     30: echo "\n";
                     31: 
                     32: 
                     33: echo "Done";
                     34: ?>
                     35: 
                     36: --CLEAN--
                     37: <?php
                     38: unlink("array_count_file");
                     39: ?>
                     40: --EXPECTF--
                     41: *** Testing array_count_values() : parameter variations ***
                     42: array(3) {
                     43:   ["bobv"]=>
                     44:   int(1)
                     45:   ["val"]=>
                     46:   int(1)
                     47:   ["val6"]=>
                     48:   int(1)
                     49: }
                     50: 
                     51: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>