(PECL lua >=0.9.0)
Lua::eval — Evaluate a string as Lua code
statements
Returns result of evaled code, NULL
for wrong arguments or FALSE
on
other failure.
Example #1 Lua::eval()example
<?php
$lua = new Lua();
$lua->eval(<<<CODE
print(2);
CODE
);
?>
以上例程会输出:
2