A few questions for people who understand well the work of the PHP interpreter.
- Does the number of opening handles affect the speed of the script? Those. there is a mixture of HTML markup and PHP code in the file, will it significantly affect performance if we open and close
<? ?>
<? ?>
on each line?
This:
<? if( $val > 0 ) { echo 'yes'; } else { echo 'no'; } ?>
or
<? if( $val > 0 ) { ?> <? echo 'yes'; ?> <? } ?> <? else { ?> <? echo 'no'; ?> <? } ?>
- Is there a difference in the speed of execution by the interpreter, the classical syntax and the alternative?
Those. between so:
<? if( $val > 0 ) { echo 'yes'; } else { echo 'no'; } ?>
and so:
<? if( $val > 0 ): echo 'yes'; else: echo 'no'; endif; ?>
options.
- Which of the output options of the variable and the results of the function uses less resources, if there is any difference at all?
This:
<? echo '$value'; ?>
or this one:
<?=$value?>