4

Possible Duplicate:
php echo vs open&close tag

Does there are any difference in Terms of Speed between:

<?php
..somephp code
?>you have 4 bananas<?php .....
..some more.... ?>

and

<?php
..somephp code
echo "You have 4 bananas";
..some more.... ?>

Thanks in Advance

Community
  • 1
  • 1
Lordareon
  • 75
  • 6
  • 5
    Yes, but it's not one worth worrying about. – ceejayoz Jan 13 '11 at 02:51
  • 2
    choosing your style should primarily benefit the readability of the code. the difference in execution time is so small it isn't worth a programmers wage. – Samuel Herzog Jan 13 '11 at 02:54
  • 1
    if it's large blocks of output, break the php, else use echo. – dqhendricks Jan 13 '11 at 02:54
  • Code for clarity and maintainance rather than worrying about performance. For the vast majority of sites, there will be greater rewards that way. So, keep your calculations (where applicable) towards the top of the pags, and just use the variables, whether in clumps or PHP islands, further along. – Luke Stevenson Jan 13 '11 at 05:29

0 Answers0