Skip to content

Instantly share code, notes, and snippets.

@Fivell
Created May 21, 2012 22:34
Show Gist options
  • Save Fivell/2765125 to your computer and use it in GitHub Desktop.
Save Fivell/2765125 to your computer and use it in GitHub Desktop.
php 5.3 autoload lambdA
<?php
spl_autoload_register(function($className)
{
$fileName = str_replace('\\', '/', ltrim($className, '\\')) . '.php';
if (file_exists($fileName)){
require $fileName;
return class_exists($className, false);
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment