Why ";" must be breaker of the code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why ";" must be breaker of the code

example : "echo 'test';"

19th Apr 2017, 10:00 AM
Farhan Qinoyz
Farhan Qinoyz - avatar
2 Answers
+ 12
Few of the symbols are choosen to be reserved for a specific purpose, which are mostly common to all programming as well as scripting languages. Here ; (semicolon or terminator) is ised for termination of a statement. And your example is errornous. Correct one is- <php echo "test"; ?>
19th Apr 2017, 11:16 AM
Sachin Artani
Sachin Artani - avatar
+ 10
it is the default rule of PHP syntax. you will find ";" with the same function in other language, like c++.
19th Apr 2017, 10:29 AM
Agus Mei
Agus Mei - avatar