From: Fabien Potencier Date: Wed, 1 May 2013 06:42:32 +0000 (+0200) Subject: fixed the autoloader for PHP 5.2 X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=eaf5a2db54cb3d6bb7c0faadd35e24a147601213;p=web%2Fkonrad%2Ftwig.git fixed the autoloader for PHP 5.2 --- diff --git a/lib/Twig/Autoloader.php b/lib/Twig/Autoloader.php index b09a2cc..7007d31 100644 --- a/lib/Twig/Autoloader.php +++ b/lib/Twig/Autoloader.php @@ -23,7 +23,11 @@ class Twig_Autoloader */ public static function register($prepend = false) { - spl_autoload_register(array(new self, 'autoload'), true, $prepend); + if (version_compare(phpversion(), '5.3.0', '>=')) { + spl_autoload_register(array(new self, 'autoload'), true, $prepend); + } else { + spl_autoload_register(array(new self, 'autoload')); + } } /**