TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Do proliferation of PHP tags affect speed? (http://www.talkphp.com/absolute-beginners/5035-do-proliferation-php-tags-affect-speed.html)

Dave 10-16-2009 09:37 PM

Do proliferation of PHP tags affect speed?
 
Are scripts that have lots of <?PHP..?> tags taking hits on execution speed, or does this actually enhance speed? Or, on the other hand, does it have no effect?

Example from book:

PHP Code:

<?php
  
// ... some PHP here...
?>

<html>
<head>
<?php
// admin page
require_once('db_login') ;
?>

<title>

<?php
// print the window title and the topmost body heading
$doc_title "Category Administration" ;
echo 
"$doc_title\n" ;
?>

</title>
</head>
<body>
<h1>

<?php
echo "$doc_title\n" ;
?>

</h1>


Village Idiot 10-16-2009 11:09 PM

If there is an effect it would be negligible at best. PHP put in HTML is easier to read and modify than HTML echo'd from PHP.

Enfernikus 10-16-2009 11:19 PM

If it does slow anything down the difference would be negligible at best and it's not often these micro optimizations that make a different but rather how to the application is designed that really slows things down when the site grows.

( On a side note, echo is actually notoriously slow on large chunks of data to my understanding )

Aaron 10-18-2009 01:04 AM

http://www.talkphp.com/tips-tricks/5...ps-tricks.html

I think #2 applies. However, I don't fully understand because of the way it was worded.


All times are GMT. The time now is 11:06 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0