https://github.com/endel/js2php

Installation

Install nodejs
Install js2php globally: npm install -g js2php

Usage

Convert a single JavaScript file into PHP:

js2php examples/simple.js > simple.php