{"id":27121,"library":"lua2php","title":"lua2php","description":"Lua to PHP transpiler that converts Lua source code into PHP. Current version 0.4.2-1. The package is experimental, with many caveats: limited Lua 5.1 support, no metatables, no loadstring, restricted print and error functions, and tables become PHP objects with an 'array' property. It works via CLI command lua2php. Suitable for niche transpilation needs, but not production-ready.","status":"active","version":"0.4.2-1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install lua2php","lang":"bash","label":"npm"},{"cmd":"yarn add lua2php","lang":"bash","label":"yarn"},{"cmd":"pnpm add lua2php","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CLI usage via npx; no programmatic API.","wrong":"lua2php input.lua","symbol":"lua2php CLI","correct":"npx lua2php input.lua"}],"quickstart":{"code":"// First, install the package:\n// yarn add lua2php\n// Then, create a Lua file example.lua:\n// -- example.lua\n// function greet(name)\n//   print(\"Hello, \" .. name)\n// end\n// greet(\"World\")\n// Finally, run:\n// npx lua2php example.lua\n// Outputs PHP code to stdout.","lang":"javascript","description":"Shows basic CLI usage: convert a Lua file to PHP using npx."},"warnings":[{"fix":"Concatenate multiple arguments into a single string before passing to print.","message":"print can only receive one string argument.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Access table elements via $table->array[index] instead of $table[index].","message":"Tables are translated to PHP objects with an 'array' property, not PHP arrays.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Avoid using these Lua features in code to be transpiled.","message":"No support for metatables, loadstring, or user-defined iterators.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}