laruence / php-lua

This extension embeds the lua interpreter and offers an OO-API to lua variables and functions.
http://pecl.php.net/package/lua
Other
149 stars 50 forks source link

fix send_zval_to_lua() #19

Closed tony2001 closed 8 years ago

tony2001 commented 8 years ago

Here's a code to test it:

$orig_callback = function() {
    return ['r'=>['user_id'=>10], 'e'=>''];
};
$Lua = new \lua();
$callback_code = 'return dump();';
$Lua->registerCallback("dump", $orig_callback);
var_dump($Lua->eval($callback_code));