How PHP's include function works behind the scenes

0

Let's say I have two pages, one call teste.php and the other teste2.php .

On page teste.php I have the following code:

...
$usuario = new Usuario();
$usuarios = $usuario->getUsuarios();
...

And on page teste2.php I have the code:

...
include "teste.php";
...

When doing the include of page teste.php on page teste2.php what process happens behind it? Php serializes the OBJ of the teste.php page and when doing the include does it use the function unserialize () in that OBJ behind the wads?

    
asked by anonymous 24.04.2017 / 18:48

1 answer

0

There is no object serialization when using include . However, PHP processes the file and gives it a specific scope, depending on where includes the other article.

The documentation explains a lot about how include works, different scopes, etc.

link

    
24.04.2017 / 19:00