PHP port of esprima