This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Vaneet Mehta
over 10 years

Semicolon?

So it said to “Go ahead and write a comparison that is true.”, so I wrote 8 > 2 between the php tag. So the final code was:

<?php
        8 > 2;  
      ?>

But it didn’t work. It only worked when I removed the semi-colon. Is that ok?

Answer 53a42aab9c4e9d05e0002ac4

4 votes

Permalink

Hi, if you put the comparison on the same line as the ‘<?php>’ it should work… it did for me anyhow…

points
Submitted by Paul George Cook
almost 10 years

2 comments

Vaneet Mehta over 9 years

Hmmm interesting. I shall try. Sounds a little broken though.

Tr0j4n V1ru5 Coding over 8 years

Thx Bro!

Answer 52324d20f10c60dec0000bb8

3 votes

Permalink

I’m having the same problem.

Moving along by removing the semicolon though.

points
Submitted by E Narcisse
over 10 years

Answer 53c3fd288c1ccc7852001601

3 votes

Permalink

The issue here isn’t the semi-colon. For some reason, if you have a single line with a > in it, the code is seen as invalid. Most likely this is due to some regular expression usage incorrectly thinking the > sign denotes the end of the PHP tag. If you convert this to !=, it shall work. Or do as Adam above me said, and use two > tags.

points
Submitted by Travis Weston
over 9 years

1 comments

Travis Weston over 9 years

I’ve submitted a proper bug report about this. Hopefully it’s taken care of.

Answer 5228b190f10c607e54004566

2 votes

Permalink

I think the semi-colon denotes the end of a code without it, it probably expect more codes that’s how I understand is

points
over 10 years

6 comments

monte_cristo over 10 years
Vaneet Mehta over 10 years

But, at this point, it didn’t ask us to make an if statement. It asks to write a comparison that is true. I know how to make an if statement, but I was trying to do the task given.

SweetHeartGirl over 10 years

Same problem here. It won’t work with a semicolon.

LegoLotRgeek111 about 10 years

I can’t get mine to work with or without the semicolon.

LegoLotRgeek111 about 10 years

I just got mine to work, actually. I had to refresh the page.

JSMorrow over 9 years

I have done it with/without a semi-colon and refreshing the page. It just won’t work. I think exercise 3 did something similar. The whole PHP lesson has been buggy as crap.

Answer 5308aaf97c82caf20a000a30

2 votes

Permalink

Me too, not a good start to the course - obviously an error.

points
Submitted by Terry Mitchell
about 10 years

Answer 530a33ae9c4e9d8e78002c81

2 votes

Permalink

So basically there has been no answer or fix for this problem? I had the same problem.

points
Submitted by Michael A. Deloney
about 10 years

Answer 542bcefd631fe928400016bb

2 votes

Permalink

  <?php
        6 < 7;
  ?>
points
Submitted by Supper Short
over 9 years

Answer 53bd951380ff332e4f00016a

1 vote

Permalink

I just compared two pairs and it’s worked.

2>1; 1>0;

points
Submitted by Adam Szczyrba
over 9 years

Answer 55816a899113cb4760000540

0 votes

Permalink

I don’t think that there is a bug.

You should ensure the operation is true.

(e.g.5 < 2; would return False).

I think the error messaging should be amended to be clearer.

points
Submitted by Mag Magusson
almost 9 years

Answer 55ad564a9113cb05e90005a2

0 votes

Permalink

there’s a mistake in the example, make sure you include the ‘echo’ command, otherwise it won’t understand what you want to do. That said, my code is correct and double checked by a tech guy i know but still won’t work. I think there is a bug in the site /: good luck. apparently it is fine in firefox if you have it :)

points
Submitted by Ciara Shrager
over 8 years

Answer 530b7bcd282ae3d7800030e0

-1 votes

Permalink

+1

points
Submitted by Yuriy Shilov
about 10 years

1 comments

jmmj0103 over 9 years

That was very helpful.