我想用那樣的eval()函數:未定義函數eval() - PHP
$foo = 'eval';
$bar = 'echo 1;';
$foo($bar);
但我發現了一個錯誤:致命錯誤:調用未定義的函數eval()
,由於下面的代碼工作它
$foo = 'base64_encode';
$bar = 'foobar';
echo $foo($bar);
誰能幫助奇怪?
我想用那樣的eval()函數:未定義函數eval() - PHP
$foo = 'eval';
$bar = 'echo 1;';
$foo($bar);
但我發現了一個錯誤:致命錯誤:調用未定義的函數eval()
,由於下面的代碼工作它
$foo = 'base64_encode';
$bar = 'foobar';
echo $foo($bar);
誰能幫助奇怪?
Note: Because this is a language construct and not a function, it cannot be called using variable functions .
繼在注意鏈接,你還會發現:
Variable functions won't work with language constructs such as
echo
,unset()
,isset()
,empty()
,include
,require
and the like. Utilize wrapper functions to make use of any of these constructs as variable functions.
這是因爲它是邪惡的! – adeneo