PonchoX
02-01-2010, 11:57 PM
hi.
i'm learning PHP. Early stages.
I'm curious. Say we have 3 separate statements. Could be anything, such as:
<?php echo "Hello world!" ?>
Would it consume more server resources to put these statements in 3 separate scripts through our HTML mark-up, such as:
<?php echo "Hello world!" ?>
HTML Mark-up.
<?php echo "Hello world!" ?>
More HTML Mark-up
<?php echo "Hello world!" ?>
Rather than:
<?php echo "Hello world!"
echo "Hello world!"
echo "Hello world!" ?>
Speaking purely theoretically. I realize that, practically speaking, these different examples would make little sense and therefore NOT be interchangable.
In other words, it seems as tho in the later example, the PHP interpreter gets turned on (and OFF) only once.
Whereas in the first example, it get turned on & off 3 times. Would the former therefore consume more server resources?
And do we therefore try to minimize interpreter start ups? For the sake of resource usage?
i'm learning PHP. Early stages.
I'm curious. Say we have 3 separate statements. Could be anything, such as:
<?php echo "Hello world!" ?>
Would it consume more server resources to put these statements in 3 separate scripts through our HTML mark-up, such as:
<?php echo "Hello world!" ?>
HTML Mark-up.
<?php echo "Hello world!" ?>
More HTML Mark-up
<?php echo "Hello world!" ?>
Rather than:
<?php echo "Hello world!"
echo "Hello world!"
echo "Hello world!" ?>
Speaking purely theoretically. I realize that, practically speaking, these different examples would make little sense and therefore NOT be interchangable.
In other words, it seems as tho in the later example, the PHP interpreter gets turned on (and OFF) only once.
Whereas in the first example, it get turned on & off 3 times. Would the former therefore consume more server resources?
And do we therefore try to minimize interpreter start ups? For the sake of resource usage?