Arrays - 3/7 - Creating Your First Array Bug with foreign characters


#1

I was working on this section and when I enter this code:

<?php
$friends = array("Ryan", "Dylan", "Zoë", "Jack");
?>

For some reason when I put this in, it returns with an error saying that I need 3 or more names, and that they need to be in quotes.

Any solutions, or is this just a bug?

Any feedback is great. Thanks!


#2

Yes, it seems a bug. Try using:

$friends = array("Ryan", "Dylan", "Zoa"); // without that ë and only three elements

as a workaround. The SCT uses a regex:

/array\s*\((?:\s*["']\s*\w+\s*['"]\s*,){2}(?:\s*["']\s*\w+\s*['"]\s*)\s*\)/

when it could have simply checked the length property of the array. I will add this to bugs spreadsheet. Thanks for reporting! :smiley:


#3

I had the same bug when I used the name "Søren"


#4

Thanks for the confirmation! Seems like the SCT is disallowing arrays when they contain one or more non-English character.


#5

Still an issue, also an issue earlier in the course when typing $myName = "Øyvind"


#6

Frank Michael is technically a first name, but it doesn't like the space.


#7

Bug is still there for the space...