Misleading Instructions in 11.7 - How to fix the code checker 'not printing' error


#1

8 // On the line below, create your own associative array:

This is misleading. The code checker is NOT looking for an associative array, it is actually looking for just a plain old array.

Make a $myArray = array('a', 'b', 'c', 'd');
echo any value
make a for loop (NOT a foreach loop) that iterates through your array.

and if someone at codecademy would fix the comments in the code, that would be great because this seems to be a common problem....


#2

The funny thing is that plain old array is also an associative array.

According to your post this code also should not be accepted:

$myArray = array(
  0 => 'a',
  1 => 'b',
  2 => 'c',
  3 => 'd'
);

This is exactly the same array.


#3

Yep.. changing to $myArray = array('a', 'b', 'c', 'd'); format bypass the checker.

But the instruction said we can use any format.. Misleading indeed...