I would like a straight forward answer if require_once is same when you do output buffering.
Approach 1
1 require_once __DIR__ . '/src/MyBaseClass.php';
Approach 2
1 ob_start();
2 require_once __DIR__ . '/src/MyBaseClass.php';
3 echo ob_get_clean();
Will these produce exactly similar behavior of loading the class?
Oh! One more thing! Just a clarification...
On Approach 2, is MyBaseClass
class on Line 2 already loaded (and ready for use)? Or is it still necessary to output the buffer (as shown in Line 3) in order to load the class in runtime?
Thanks in advance. Cheers!