+ 8

This code should show error. But it is not showing. Some one help please.

According to the php course in sololearn, if we didn't keep semicolon at the end it should show error. But this code is not showing. <?php echo "A"; echo "B"; echo "C" ?> I Removed semicolon at the end of C. https://code.sololearn.com/wX6GxOKHFB3M/?ref=app

5th May 2020, 7:28 AM
Puthur Harthik
6 Antworten
+ 4
Semicolons are statement separator, PHP can ignore the missing semicolon because there is nothing more to process past the last statement `echo "C"`. Try adding one more statement after the last statement in current code. You will see what I mean : )
5th May 2020, 7:36 AM
Ipang
+ 5
Thanks Ipang sir
5th May 2020, 7:42 AM
Puthur Harthik
+ 5
Ok Ipang 😅
5th May 2020, 7:46 AM
Puthur Harthik
+ 4
But sir if I remove semicolon after A or B it is showing error
5th May 2020, 7:37 AM
Puthur Harthik
+ 4
No problem buddy 👌 And don't sir me please, I'm just a guy 😁
5th May 2020, 7:46 AM
Ipang
+ 3
That's what I mean, PHP forgives a missing semicolon only for the very last statement, nowhere else : )
5th May 2020, 7:40 AM
Ipang