From eaf5a2db54cb3d6bb7c0faadd35e24a147601213 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 1 May 2013 08:42:32 +0200 Subject: [PATCH] fixed the autoloader for PHP 5.2 --- lib/Twig/Autoloader.php | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) 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')); + } } /** -- 1.7.2.5