• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

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
0
phparmy
Asked:
phparmy
3 Solutions
 
psimationCommented:
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 ;
0
 
lpxtechCommented:
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.
0
 
bishilloCommented:
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now