I\'ve read quite a few posts that are very similar to the question I\'m about to ask, but I just wanted to be sure that there wasn\'t a more sophisticated way to do this. Any f
You could have the required file return an anonymous function, and then call it immediately after.
//required.php $test = function($param) { //do stuff } return $test
//main.php $testing = require 'required.php'; $testing($arg);