php咖喱运行时错误

I'm trying to follow a tutorial called "Roll Your Own Templating System". It's very sloppy but I've managed to fix most of the author's errors. I'm guessing the error is coming from the generate_markup method which calls the _parse_template method. So it is definitely coming from the curry method. I guess it doesn't understand the Template::part. Any ideas?

index.php

<?php

    require_once "build/class/Template.class.php";

    $template = new Template;
    $template->template_file = "header.php";
    echo $template->generate_markup();

_parse_template, _curry, and generate_markup

private function _parse_template($extra=NULL) {
    $template = $this->_template;
    $comment_pattern = array('#/\*.*?\*/#s', '#(?<!:)//.*#');
    $template = preg_replace($comment_pattern, NULL, $template);

    $pattern = '#.*{loop}(.*?){/loop}.*#is';
    $entry_template = preg_replace($pattern, "$1", $template);

    $header = trim(preg_replace('/^(.*)?{loop.*$/is', "$1", $template));
    if($header===$template) {
        $header = NULL;
    }

    $footer = trim(preg_replace('#^.*?{/loop}(.*)$#is', "$1", $template));
    if($footer===$template) {
        $footer = NULL;
    }

    $tag_pattern = '/{(\w+)}/';
    $callback = $this->_curry('Template::replace_tags', 2);

    $markup = NULL;

    for($i=0, $c=count($this->entries); $i<$c; ++$i ) {
        $markup .= preg_replace_callback($tag_pattern, $callback(serialize($this->entries[$i])), $entry_template);
    }

    return $markup;
}

public function _curry($func, $arity) {
    return create_function('', "
        \$args = func_get_args();
        if(count(\$args) >= $arity) {
            return call_user_func_array('$func', \$args);
        }
        \$args = var_export(\$args, 1);
        return create_function('','
            \$a = func_get_args();
            \$z = ' . \$args . ';
            \$a = array_merge(\$z,\$a);
            return call_user_func_array('$func', \$a);
        ');
    ");
}

public function generate_markup($extra=array()) {
    $this->_load_template();
    return $this->_parse_template($extra);
}

error

Parse error: syntax error, unexpected 'Template' (T_STRING) 
   in C:\xampp2\htdocs\build\class\Template.class.php(62) :
   runtime-created function on line 11