Question: If someone can help me about the way that php executes seperate files.
For example I have:

```
                 index.php
                 /       \
            parent.php
            /        \
      child.php    functions.php
     <codeChild>  <codeFunctions>

```

In 'codeChild' can I execute a function from 'codeFunctions'
if 'child.php' includes after 'codeFunctions'?

How php hundles these `includes(file)` ?
Is it execute the child.php and returns all exposed values and 'parent.php' or
inherits all the code into 'parent.php' ?

Answer: 
When you talk about `include` and `require` in PHP that simply mean

> 
> These(include & require) function takes all the text in a specified file and copies it into the file that uses the include function.
> 
> 
> 

Point(s)

* You can call a function before it is defined but when it is in same file. That's because PHP first parses the file and then executes it.
* If function is defined in an other file, you must include the file before calling the function.

```
foo();
include_once 'other_file.php';
--->   PHP Fatal error as foo is defined in other file

```

The correct way to use it.

```
include_once 'other_file.php';
foo();

```
if you including files using `include` then you can use. It like

When you have file `index.php`

```
<?php

include('parent.php');

?>

```

When you have file `parent.php`

```
<?php

include('child.php');
include('functions.php');

?>

```

Output of this after compilation is like below :

```
<?php

abc();

//parent.php

function parent()
{
    echo "parent";
}
// function.php
function test(){
    echo "abc";
}

// chid.php
function chid(){
    echo "xyz";
}
chid();

```