.php filenames for non-PHP files

Discussion in 'PHP' started by bigjoe4, Aug 5, 2008.

  1. #1
    Can you tell me exactly how long in milliseconds it will take the server to parse a 3KB .php file that contains no PHP code?
     
    bigjoe4, Aug 5, 2008 IP
  2. Le4rner

    Le4rner Active Member

    Messages:
    80
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #2
    It will not parse it at all. ;)

    In php a php block <?php to ?> is parse by the server. Things in single quotes however are not parse and treated as plain text. For example

    
    <?php
    $var = 'some text';
    
    echo 'My var is $var';
    
    echo "My var is $var";
    
    ?>
    
    PHP:
    The first echo statement would return:

    My var is $var

    The second echo statement would return:

    My var is some text


    The difference is one string was parsed, the other treated like plain text. In cases where you have a php file extension, php will not enguage the file until it finds a php block of code.

    And as far as exact milliseconds, that depends on a ton of stuff man. How fast is your server? What version of PHP, on windows or a LAMP stack? How many processors and are the multi core or the older multi stand alone processors?

    I hope I helped but your question is a bit vague.
     
    Le4rner, Aug 5, 2008 IP
    bigjoe4 likes this.
  3. bigjoe4

    bigjoe4 Guest

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    PHP version is 5.2.5, Apache version 2.2.8, Quad core 2.4GHz processor, 4gigs RAM
     
    bigjoe4, Aug 8, 2008 IP