What could cause an object not be passed down included files?


In wordpress: index.php

require_once 'Test/Test.php';
$test = new Test();

<?php get_template_part( 'main' ); ?>

For a reason I don’t understand, I have to re-include and re-instantiate Test() in main.php.

Shouldn’t the class be available everywhere?



What does your class or function do? That could be the reason.