Rico Ocepek
Rico Ocepek

Reputation: 815

php types of inclusion

I just read some articles about php's require / require_once respectively include / include_once and was just wondering when _once should be used? Is it just the performace aspect or can I run into any difficulties when including / requiring the same file multiple times?

Upvotes: 1

Views: 51

Answers (1)

Sergiu Paraschiv
Sergiu Paraschiv

Reputation: 10163

Think about this scenario:

<?php

function a() {
}

?>

What's going to happen when you include/require it twice? "function a already declared".

Upvotes: 1

Related Questions