"{$digest}"]; class ParentClass { protected function getKey(\$key) { global \$arr; return \$arr[\$key]; } } class {$className} extends ParentClass { private const {$constName} = '{$constValue}'; function __construct(\$prop) { \$this->{$propName} = \$prop; } function {$methodName}(\$key) { \$digest = \$this->getKey(\$key); if (md5(self::{$constName}.\$this->{$propName}) !== \$digest) { die("check error: md5(" .self::{$constName}.\$this->{$propName}.") != " . \$digest); } echo "OK\\n"; } } \${$instName} = new {$className}("{$propValue}"); \${$instName}->{$methodName}("{$arrayKey}"); EOT;