lua2php
v0.4.2-1
Published
A Lua to PHP Transpiler.
Downloads
60
Readme
lua2php
A Lua to PHP transpiler.
Usage
CLI
$ yarn add lua2php
$ npx lua2php a.luaExamples
Visit examples.
Implementation
- Table =>
(object)["array"=>[......]] #a=>count(a->array)
Different from Lua5.1
- Can only get the length of a continuous array.
- No
loadstring, metatable, user-defined iterator ... table,unpack,tostring,print,error,string,pairs,ipairscannot be used as normal identifiers.errorcan only receive one string argument. Translated tothrow new Exception()printcan only receive one string argument.string.subcan only receive one string and two positive integers.- The value of
... and ...,... or ...is boolean. - Multiple return or assignment or
for a,b,c in pairs(...)(cisnil) or ... is not supported (except...=unpack(...)) - No TCO
- The variables captured in closures in the loop are the variables in the last.
for k, v in pairs(...). There is no+1whenkis a number.
Projects using lua2php
- The Language An experimental programming language.
