Test: /ext/standard/tests/array/count_recursive.phpt - Version 7.3.1    

There is 1 diff reported by users for this test.

Count Diff
1 (100%)
003+ COUNT_NORMAL: should be 0, is 0
003-
004- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
005- COUNT_NORMAL: should be 0, is 0
006-
007- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
012+ COUNT_NORMAL: should be 1, is 1
013+ COUNT_RECURSIVE: should be 1, is 1
014+ -- Testing various types with no second argument --
016+ COUNT_NORMAL: should be 2, is 2
017+ -- Testing really cool arrays --
018+ COUNT_NORMAL: should be 3, is 3
019+ COUNT_RECURSIVE: should be 13, is 13
016-
017- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
020- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
021- COUNT_RECURSIVE: should be 1, is 1
022- -- Testing various types with no second argument --
021+ *** Testing possible variations of count() function on arrays ***
022+ -- Iteration 0 --
023+ COUNT_NORMAL is 0
024+ COUNT_RECURSIVE is 0
025+
026+ -- Iteration 1 --
027+ COUNT_NORMAL is 1
028+ COUNT_RECURSIVE is 1
029+
030+ -- Iteration 2 --
031+ COUNT_NORMAL is 4
032+ COUNT_RECURSIVE is 7
033+
034+ -- Iteration 3 --
035+ COUNT_NORMAL is 2
036+ COUNT_RECURSIVE is 8
037+
038+ -- Iteration 4 --
039+ COUNT_NORMAL is 4
040+ COUNT_RECURSIVE is 4
041+
042+ -- Iteration 5 --
043+ COUNT_NORMAL is 5
044+ COUNT_RECURSIVE is 5
045+
046+ -- Iteration 6 --
047+ COUNT_NORMAL is 6
048+ COUNT_RECURSIVE is 6
049+
050+ -- Iteration 7 --
051+ COUNT_NORMAL is 4
052+ COUNT_RECURSIVE is 7
053+
054+ -- Testing count() on constants with no second argument --
055+ COUNT_NORMAL: should be 1, is 1
056+ COUNT_NORMAL: should be 1, is 1
057+
058+ -- Testing count() on NULL and Unset variables --
059+ COUNT_NORMAL: should be 0, is 0
060+ COUNT_NORMAL: should be 1, is 1
061+ COUNT_NORMAL: should be 0, is 0
062+
063+ -- Testing count() on an empty sub-array --
064+ COUNT_NORMAL: should be 2, is 2
065+ COUNT_RECURSIVE: should be 5, is 5
066+
067+ -- Testing count() on objects with Countable interface --
068+ COUNT_NORMAL: should be 3, is 3
069+
070+ -- Testing count() on resource type --
071+ int(2)
024- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
025- COUNT_NORMAL: should be 1, is 1
026- COUNT_NORMAL: should be 2, is 2
027- -- Testing really cool arrays --
028- COUNT_NORMAL: should be 3, is 3
029- COUNT_RECURSIVE: should be 13, is 13
031- *** Testing possible variations of count() function on arrays ***
073+ -- Testing count() on arrays containing references --
074+ For mode '0' count is => int(3)
075+ For mode '1' count is => int(9)
076+ For mode '0' count is => int(3)
077+ For mode '1' count is => int(9)
078+ For mode '-1' count is => int(3)
079+ For mode '-1.45' count is => int(3)
080+ For mode '2' count is => int(3)
081+ For mode '1' count is => int(9)
082+ For mode '' count is => int(3)
083+ For mode '' count is => int(3)
084+
085+ -- Testing error conditions --
086+ Warning: count() expects at least 1 parameter, 0 given in %s/count_recursive.php on line 113
087+ NULL
088+
089+ Warning: count() expects at most 2 parameters, 3 given in %s/count_recursive.php on line 114
090+ NULL
091+
092+ Warning: Use of undefined constant ABCD - assumed 'ABCD' (this will throw an Error in a future version of PHP) in %s/count_recursive.php on line 117
093+
094+ Warning: count() expects parameter 2 to be int, string given in %s/count_recursive.php on line 117
095+ NULL
096+
097+ Warning: count() expects parameter 2 to be int, string given in %s/count_recursive.php on line 118
098+ NULL
099+
100+ Warning: count() expects parameter 2 to be int, string given in %s/count_recursive.php on line 119
101+ NULL
103+ Done
032- -- Iteration 0 --
033- COUNT_NORMAL is 0
034- COUNT_RECURSIVE is 0
035-
036- -- Iteration 1 --
037- COUNT_NORMAL is 1
038- COUNT_RECURSIVE is 1
039-
040- -- Iteration 2 --
041- COUNT_NORMAL is 4
042- COUNT_RECURSIVE is 7
043-
044- -- Iteration 3 --
045- COUNT_NORMAL is 2
046- COUNT_RECURSIVE is 8
047-
048- -- Iteration 4 --
049- COUNT_NORMAL is 4
050- COUNT_RECURSIVE is 4
051-
052- -- Iteration 5 --
053- COUNT_NORMAL is 5
054- COUNT_RECURSIVE is 5
055-
056- -- Iteration 6 --
057- COUNT_NORMAL is 6
058- COUNT_RECURSIVE is 6
059-
060- -- Iteration 7 --
061- COUNT_NORMAL is 4
062- COUNT_RECURSIVE is 7
063-
064- -- Testing count() on constants with no second argument --
065-
066- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
067- COUNT_NORMAL: should be 1, is 1
068-
069- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
070- COUNT_NORMAL: should be 1, is 1
071-
072- -- Testing count() on NULL and Unset variables --
073-
074- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
075- COUNT_NORMAL: should be 0, is 0
076-
077- Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d
078- COUNT_NORMAL: should be 1, is 1
079- COUNT_NORMAL: should be 0, is 0
080-
081- -- Testing count() on an empty sub-array --
082- COUNT_NORMAL: should be 2, is 2
083- COUNT_RECURSIVE: should be 5, is 5
084-
085- -- Testing count() on objects with Countable interface --
086- COUNT_NORMAL: should be 3, is 3
087-
088- -- Testing count() on resource type --
089- int(2)
090-
091- -- Testing count() on arrays containing references --
092- For mode '0' count is => int(3)
093- For mode '1' count is => int(9)
094- For mode '0' count is => int(3)
095- For mode '1' count is => int(9)
096- For mode '-1' count is => int(3)
097- For mode '-1.45' count is => int(3)
098- For mode '2' count is => int(3)
099- For mode '1' count is => int(9)
100- For mode '' count is => int(3)
101- For mode '' count is => int(3)
102-
103- -- Testing error conditions --
104- Warning: count() expects at least 1 parameter, 0 given in %s on line %d
105- NULL
106-
107- Warning: count() expects at most 2 parameters, 3 given in %s on line %d
108- NULL
109-
110- Warning: Use of undefined constant ABCD - assumed 'ABCD' (this will throw an Error in a future version of PHP) in %s on line %d
111-
112- Warning: count() expects parameter 2 to be int, %s given in %s on line %d
113- NULL
114-
115- Warning: count() expects parameter 2 to be int, %s given in %s on line %d
116- NULL
117-
118- Warning: count() expects parameter 2 to be int, %s given in %s on line %d
119- NULL
120-
121- Done