enphp_file($file, $target_file, $options);
log::info('encoded', $target_file);
$old_output = $output = array();
// run encoded & old script
exec('php -d error_reporting=0 "' . $target_file . '"', $output);
exec('php -d error_reporting=0 "' . $file . '"', $old_output);
$output = implode("\n", $output);
$old_output = implode("\n", $old_output);
$old_output = strtr($old_output, [realpath($file) => realpath($target_file)]);
// compare result
if ($old_output == $output) {
log::info('SUCCESS_TEST');
} else {
log::info('FAILURE_TEST');
echo str_repeat('===', 5);
echo "\r\nold=", trim($old_output), "\r\n";
echo str_repeat('===', 5);
echo "\r\nnew=", trim($output), "\r\n";
break;
}