This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Control Flow: Switch Forum

View Course » View Exercise

408 points
B13465219263fa8ce885889a9f77a94b?s=140&d=retro
Submitted by
Shnikers
over 3 years ago

This Has to Be a Bug...

This is probably one of the many exercises that I've come across on Codecademy that has a bug. There is nothing wrong with the code...
<?php
if(4==5) {
echo "I hate you!";
} else {
echo "Cheese!!!";
}
?>

And Codecademy is acting particularly slow today...Maybe that's it...


4 votes

permalink

Actually, never mind. I turned out that you had to do an elseif statement too. Updated code is:
<?php
if(6==6) {
echo "I hate you!";
} elseif {
echo "Cheese!!!";
} else {
echo "Napkin!!!!!!!!!!!";
?>

408 points
B13465219263fa8ce885889a9f77a94b?s=140&d=retro
Submitted by
Shnikers
over 3 years ago


0 votes

permalink

And what's wrong with it - <!DOCTYPE html>





<?php
if(4==5) {
echo "I hate you!";
} elseif (100==2)
echo "wykop111";
else {
echo "Cheese!!!";
}
?>

??

61 points
Edd6cc28a61109754103f2ea631307f2?s=140&d=retro
Submitted by
sebastian.grodecki
about 3 years ago

1 Comment

8dbc99d3b0826325f6be10f50efb5fb1?s=140&d=retro S├ębastien Nadaus about 3 years ago

it miss {] at elsif condition