{"library":"phptojs","title":"PHPToJS","description":"PHP-to-JavaScript transpiler that converts PHP code into JavaScript code. Version 10.3.0 is the latest stable release, with irregular release cadence. It supports a subset of PHP syntax, including classes, closures, and namespaces, but does not target full PHP compatibility. Key differentiators include the ability to run PHP code in the browser without a server, and integration with the Uniter project. However, it is not actively maintained and has known limitations with newer PHP features.","language":"javascript","status":"maintenance","last_verified":"Fri May 01","install":{"commands":["npm install phptojs"],"cli":{"name":"phptojs","version":null}},"imports":["import PHPToJS from 'phptojs';","import { transpile } from 'phptojs';","import PHPToJSEngine from 'phptojs/lib/Engine';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import PHPToJS from 'phptojs';\n\nconst phptojs = new PHPToJS();\nconst phpCode = `<?php\nfunction hello($name) {\n    return 'Hello, ' . $name . '!';\n}\necho hello('world');\n?>`;\nconst jsCode = phptojs.transpile(phpCode);\nconsole.log(jsCode);","lang":"javascript","description":"Transpile a simple PHP function to JavaScript.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}