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

Conversion of Lua->PHP callables when passing to a PHP callable fails #29

Open danog opened 7 years ago

danog commented 7 years ago

Since in https://github.com/laruence/php-lua/blob/master/lua.c#L305, a Lua object is not passed to the Lua->zval conversion function (it cannot be fetched using getThis because we're in a function called from the Lua environment), conversion of Lua callables to PHP callables when they are passed as parameters to a PHP callable fails. I thought of a workaround: why not store all relevant data from every Lua object into lua_ce? While I'm trying to figure out a way to implement this (kinda new to this), some feedback from the dev would be appreciated.

P.S. Nice fail with the creation of the issue eh?