PHP Performance Question effect of ;

Which one is good for performance
<?php echo "Something";?> or <?php echo "Something"?>

what is the effect of ; to performance
Who is Participating?
lpxtechConnect With a Mentor Commented:
Also, to add to what psimation stated. For a simple php echo statement in html you can also use the shorthand version <?="something"?> or <?=$myVariable?> it won't hurt your performance, and it sure saves you a few keystrokes.
psimationConnect With a Mentor Commented:
AFAIK, the ";" has absolutely no implication on performance at all. It is used only for syntax.

In your example above, you don't need the ; at all, since there is nothing following, but for multiple calculations, assignments etc, you need to use ;
bishilloConnect With a Mentor Commented:
It won't have any performance impact. Take into account that the PHP file is parsed before execution, so it won't make any difference but in the first parsing, perhaps. You won't notice any measurable impact anyway. As lpxtech said, <?=$var?> is very handy for fast coding and for getting a more readable code.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.