[Help] php including files

GarettM

Posting Freak
Aug 5, 2010
833
136
What is more efficient?
I'm on my phone sorry for php or word errors

Requiring every class directly
PHP:
<?php
  Require('example.class.php');
  $foo = new example;
?>
Or through an autoload function?
PHP:
<?php
SPL_autoload_register( function($class) {
    Require("$class.class.php");
  });
  $foo = new example;
?>
 

Users who are viewing this thread

Top