Page 1 of 1

Comments -- Laggin up your script?

Posted: Sun Dec 21, 2003 8:09 pm
by nigma
Hey, when you put comments in a PHP script will it make the script run slower?

I looked at the php homepage for some info on comments but didn't find what I was looking for.

Posted: Sun Dec 21, 2003 8:46 pm
by DuFF
From PHP.FAQTs:
If a PHP script is loaded heavily with comments, does the page load more slowly by Apache (to parse out the comments)?

Jan 22nd, 2002 08:54

MÃ¥rten Gustafsson, Ben Udall, Shelly Shaw


From a mail to php-dev by Andi Gutmans [2001-01-13]:
"As it is a compile first, execute later interpreter it will in
practice not slow down your code. Of course if your script has only a
very small amount of flat code (no loops/function calls) and a huge
amount of comments (tens of KB) then it could theoretically make a
difference but in reality it doesn't."

Posted: Sun Dec 21, 2003 9:04 pm
by nigma
Well duff, although I deserve to feel like a fool, I apreciate you responding without blatantly pointing it out. Thanks.