Activity Stream
48,167 MEMBERS
61044 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 8 of 8
  1.     
    #1
    Member
    Website's:
    maxneeds.info

    Default <?php tag question

    Hi there.
    I was wondering if i have many <?php tags in a single page - does that slow down the processing ?

    Like
    <?php echo 1; ?>
    <?php echo 2; ?>
    Of course that's a silly example .. i am talking about much more complex stuff.

    Thanks
    Porsche_maniak Reviewed by Porsche_maniak on . <?php tag question Hi there. I was wondering if i have many <?php tags in a single page - does that slow down the processing ? Like <?php echo 1; ?> <?php echo 2; ?> Of course that's a silly example .. i am talking about much more complex stuff. Thanks Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    You can try it your self.
    By this code:
    PHP Code: 
      <?php
    $time_start 
    microtime(true);

    // Your stuff here....


    $time_end microtime(true);
    $time $time_end $time_start;

    echo 
    "Process took $time seconds\n";
    ?>
    I dont think this will slow down.
    But try and let us also know.
    No Signature This Time

  4.     
    #3
    Member
    This site is using a hacked database of W junction
    Last edited by Gavo; 4th Jan 2015 at 02:31 PM.

  5.     
    #4
    Member
    Website's:
    maxneeds.info
    Yea that's was a good idea.
    So i tested for 4 echo's - 1st test was with only 1 php tag. So in each refresh it was giving different results but average of 1.45 sec.

    And 2nd test with 4 more php tags (for each echo) gave average result of 1.47 sec.
    So i guess it is really close and no worry about using many php tags. Thanks

    EDIT : But hey it has 0.02 delay ! LOL

  6.     
    #5
    Member
    Website's:
    FlowForums.com
    I think it wouldn't matter. I use php tags all day to link in files.

  7.     
    #6
    Member
    on micro level it does matter. Every letter is one byte and use memory and process, but most people don't notice it. I even asked Chuck Norris and he didn't notice it. He had to slow time...

  8.     
    #7
    The Wise One
    Website's:
    twilight.ws ddlrank.com
    Excellent example of premature code optimization. Stuff like this doesn't matter at all. You code in a structured and clean way to avoid any speed issues and in the end if you are still experiencing slowness you identify the bottleneck and eliminate it ;-)

    Sent from my super awesome Samsung Galaxy S II
    I can always be contacted by sending a tweet @twilightws

  9.     
    #8
    Member
    Website's:
    tehMoviez.com 0Senes.com GeekFaceGames.com
    using separate tags helps in one condition: you have static html contents withing the pages (eg global page layout and html tags) so you put them outside php tags because you don't need php to process them and they are sent directly. Obviously you would win a couple of milliseconds

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Little question
    By manthing in forum Paypal
    Replies: 4
    Last Post: 27th Jun 2012, 10:46 AM
  2. DLE question
    By Divvy in forum Webmaster Discussion
    Replies: 4
    Last Post: 2nd Apr 2011, 03:00 PM
  3. Replies: 5
    Last Post: 3rd Jan 2010, 05:23 PM
  4. question
    By priviet02 in forum Hosting Discussion
    Replies: 2
    Last Post: 24th Sep 2009, 02:07 PM
  5. Question!
    By Luke in forum General Discussion
    Replies: 8
    Last Post: 23rd Sep 2009, 03:30 PM
BE SOCIAL