0
I removed the t semicolon from the the last line it is also working correctly why?
<?php echo "1"; echo "2"; echo "3" ?> like these
2 Respuestas
+ 1
The funny part is, it doesn't work if it wasn't the very last line. If the semicolon for printing "2" was removed for example.
Perhaps PHP sees that it was the last instruction, or probably automatically inserts a semicolon there and be forgiving.
Interesting! I vaguely remember someone asked this before, but maybe the question was poorly tagged, it can't be found now :(
+ 1
If a closing php tag is encountered, it implies a semicolon.
For good practice and readability, it's best to use semicolons to reduce the likelihood of errors.
https://www.dummies.com/programming/php/php-syntax/