Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ static int php_lua_call_callback(lua_State *L) {
/* }}} */

zval *php_lua_get_zval_from_lua(lua_State *L, int index, zval *lua_obj, zval *rv) /* {{{ */ {
#if (LUA_VERSION_NUM >= 503)
if (lua_isinteger(L, index)) {
ZVAL_LONG(rv, lua_tointeger(L, index));
return rv;
}
#endif
switch (lua_type(L, index)) {
case LUA_TNIL:
ZVAL_NULL(rv);
Expand Down Expand Up @@ -340,9 +346,11 @@ zval *php_lua_get_zval_from_lua(lua_State *L, int index, zval *lua_obj, zval *rv

switch (Z_TYPE(key)) {
case IS_DOUBLE:
case IS_LONG:
add_index_zval(rv, Z_DVAL(key), &val);
break;
case IS_LONG:
add_index_zval(rv, Z_LVAL(key), &val);
break;
case IS_STRING:
add_assoc_zval(rv, Z_STRVAL(key), &val);
zval_ptr_dtor(&key);
Expand Down