Both the $myVar assignment in line 1 and the $higher assignment in line 2
are dead. The first because $myVar is never used and the second because
$higher is always overwritten for every possible time line.
Loading history...
31
}
32
33
public function testdoIterateOnArray() {
34
35
$expected = array(
36
1 , 42
37
);
38
39
$mappingIterator = new MappingIterator( $expected, function( $counter ) {
40
return $counter;
41
} );
42
43
foreach ( $mappingIterator as $key => $value ) {
44
$this->assertEquals(
45
$expected[$key],
46
$value
47
);
48
}
49
}
50
51
public function testdoIterateOnArrayIterator() {
52
53
$expected = array(
54
1001 , 42
55
);
56
57
$mappingIterator = new MappingIterator( new ArrayIterator( $expected ), function( $counter ) {
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: