eval版本问题
Cain 2006-02-06 11:22:10 // test.php
<?php
class A{
function getA() {
return "aaa";
}
}
$A = new A;
$content = file_get_contents("./a.xml");
eval("\$tmp = \"$content\";");
echo $content. "<br>";
echo $tmp;
?>
// a.xml
{$A->getA()} {$A->getA()}
在5.0下可以正常运行,得到如下结果:
{$A->getA()} {$A->getA()}
aaa aaa
但在4.3下却无法得到预期的运行结果,
不知各位有没有遇到过。