TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-16-2009, 09:37 PM   #1 (permalink)
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default 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>
Dave is offline  
Reply With Quote
Old 10-16-2009, 11:09 PM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

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.
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
Dave (10-17-2009)
Old 10-16-2009, 11:19 PM   #3 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

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 )
__________________
My Blog
Enfernikus is offline  
Reply With Quote
The Following User Says Thank You to Enfernikus For This Useful Post:
Dave (10-17-2009)
Old 10-18-2009, 01:04 AM   #4 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default

35 PHP programming tips/tricks.

I think #2 applies. However, I don't fully understand because of the way it was worded.
__________________
Signatures are nothing but incriminating.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
The Following User Says Thank You to Aaron For This Useful Post:
Dave (10-18-2009)
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace special chars not tags, php trigered by html Peuplarchie General 0 09-20-2009 02:32 PM
PHP Tags Issue.. skv Absolute Beginners 9 06-22-2009 02:42 PM
file_get_contents with PHP tags hello-world Absolute Beginners 4 03-30-2009 08:32 PM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM


All times are GMT. The time now is 01:40 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design