使用grunt-hazy的混淆PHP有语法错误

I'm getting to know Grunt, trying to do some obfuscation of my test php file.

Here's the original code, just a simple hello world

<?php
echo 'hello world';

Obfuscated using grunt-hazy:

<?php eval("?>".base64_decode("PD9waHANCmVjaG8gJ2hlbGxvIHdvcmxkJzs=")."<?"); ?>

And the error:

Parse error: syntax error, unexpected '<' in D:\Projects\Grunter\hazed\index.php(1) : eval()'d code on line 2

Here's my Gruntfile

module.exports = function(grunt){
    grunt.initConfig({
        hazy: {
            php: {
                expand: true,
                cwd: '',
                dest: 'hazed',
                src: [ '*.php' ]
            }
        },
        watch: {
            scripts: {
                files: ['*.php'],
                tasks: ['hazy']
            }
        }
    });

    grunt.loadNpmTasks('grunt-hazy');
    grunt.loadNpmTasks('grunt-contrib-watch');
};

What am I doing wrong? Is it a bug with the plugin?

Looking at the decoded code that's ran through eval, you get this.

?><?php
echo 'hello world';<?

So as you can see, you close a PHP tag, then it opens a new one, echoes some text, then tries to open another tag without closing the first one.

If you try adding a closing PHP tag in your test script, my guess is it will work fine.