2 Error when registering autoload with non-static autoload already on SPL stack
5 if (!function_exists('spl_autoload_register')) {
6 echo "skip - spl_autoload_register() not available";
8 if (version_compare(PHP_VERSION, '5.2.11', '>=')) {
9 echo "skip - non-buggy version of PHP";
15 public function autoload($class) {
16 echo "Autoloading... $class" . PHP_EOL;
17 eval("class $class {}");
21 $obj = new NotStatic();
22 spl_autoload_register(array($obj, 'autoload'));
25 require '../library/HTMLPurifier.auto.php';
26 } catch (Exception $e) {
27 echo 'Caught error gracefully';
28 assert('strpos($e->getMessage(), "44144") !== false');
32 Caught error gracefully