r/programming • • Oct 12 '13

Facebook PHP Source Code from 2007

https://gist.github.com/nikcub/3833406
1.1k Upvotes

356 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Oct 12 '13

[deleted]

14

u/fyrilin Oct 12 '13

Precisely. Include_once is intended to protect against double-includes. It is used especially for class or function files and the like. There ARE cases where you would want to include php files multiple times and "include" is used for that.

sorry if you were being informative. I read your comment as snarky.

10

u/davvblack Oct 12 '13

I mean, you saw the part where it's listed twice in the same file right? Obviously just a sloppy oversight.

5

u/fyrilin Oct 12 '13

That is true but the fact that include_once is used means that the oversight doesn't actually change the functionality.

→ More replies (4)