Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6663629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:31:13+00:00 2026-05-26T02:31:13+00:00

I read that when the PHP lexer parses the php and encounters a doccomment,

  • 0

I read that when the PHP lexer parses the php and encounters a doccomment, that it stores the contents of that comments as metadata. So I would assume this might have a slight overhead compared to using regular comments in non-doccomment format?

Regular comment…

<?php

/*
some text
/*
// more comments

?>

doccomment…

<?php
/**
 * @author Kenneth Davis
 * @copyright 2011
 * @filename Exception.class.php
*/
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:31:13+00:00Added an answer on May 26, 2026 at 2:31 am

    As others have mentioned, the difference is so small that it doesn’t matter. But to answer your question, there is a difference in runtimes. To test this, I’ve generated two php files, each with 50000 classes, and each weighing in at exactly 4288896 bytes.

    Here’s the template I used for the docblock version:

    /**
     * My Docblock
     */
    class MyClass%s {}
    

    and here’s the version with no true docblock (without the two * at the
    beginning, ReflectionClass::getDocComment() did not find the comment):

    /*-
     * My Docblock
     */
    class MyClass%s {}
    

    The full script to generate the php files is here: https://gist.github.com/1268179

    To see any noticable difference in time, I had to run each through php 10 times, like so:

    time yes docblock.php | head -n 10 | xargs -n 1 php
    

    Here’s the outcome:

    with docblocks:

    xargs -n 1 php  2.22s user 0.63s system 99% cpu 2.873 total
    

    without docblocks:

    xargs -n 1 php  2.16s user 0.63s system 99% cpu 2.813 total
    

    Running this several times, seemed to yield consistent faster (barely) times for
    the no docblock version.

    To sum it up, that’s about 0.00012 milliseconds per docblock that php keeps
    track of (if I did my math right there).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, this might be a very noob question, but I find that PHP Documentation
I read that I have to download this http://dev.mysql.com/downloads/mirror.php?id=13427#mirrors , but it says that
PHP's documentation on this function is a bit sparse and I have read that
i need to fetch a url with javascript/jquery and not php. i've read that
I'm looking for an editor that can read and write remote PHP files via
I read data from a mysql database that has is filled by php scripts.
I am trying to read some settings from php.ini using zend. The API that
I've read that major changes were made in PHP 5 to the OO structure,
The PHP documentation states that php://input can only be read once. In my application
I have read that when including a php file that using absolute paths has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.