Simulate PHP functions in Lua