js2php is an experimental JavaScript to PHP source-to-source transpiler (version 0.1.7). It converts ES6 features like classes, arrow functions, template strings, and many core JavaScript prototypes (Array, JSON, Math, etc.) into PHP. The project is clearly marked as experimental and not recommended for production use. It is published on npm and has an online demo. There is no active development or maintenance; it is effectively abandoned.
npm install js2phpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows CLI installation and basic usage: converting a JavaScript arrow function to PHP.
Do not use in production. Consider alternatives like ReactPHP or writing PHP directly.
Do not rely on it. There is no active maintenance.
Test your code thoroughly. Many JavaScript constructs will not transpile.
Rewrite the code to use supported features only, or use a different transpiler.
Do not use require() in the source JavaScript; write code that does not depend on Node.js APIs.
No dependency data recorded yet.