Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 7
NO SEMICOLON BUT NO ERROR IT WORKED WHY?
in the exercise it was written that if I dont put semicoln ; at the end of echo "...."; it will result in error I experiment it by myself it gets output and no error pop up whyy?
3 Answers
+ 22
Newer PHP versions dont require semicolons as JS doesnt (mainly because they dont require compilation and the interpreters are now smart enough to see that), but it is HIGHLY recommended you use them to prevent errors in the future
+ 3
I tried this in Code Playground and got slapped in the face : )
I guess SoloLearn version is old ... ?
<?php
echo "<p>Is it true PHP doesn't require semicolon anymore?<br />"
echo "Is that a fact? <br />maybe curly brackets be gone next ... XD</p>"
?>
+ 2
php isn't sever in many rules of syntaxe ..