Variables & scope
adds let where a variable is born and hoists the ones php lets you set inside blocks.
reverse engineering for php apps, right in your browser
drop a folder of up to ten php files and porter reverse engineers the logic, arrays, classes and builtins back out as clean javascript source. no signup, no api keys, and your code never leaves the tab.
let crew = {'ada': 36, 'linus': 28};
for (const [name, age] of Object.entries(crew)) {
console.log(name.charAt(0).toUpperCase() + name.slice(1) + ` is ${age}`);
}
drag a project in. porter picks up to ten .php files and skips vendor and node_modules.
flip between files, tweak the php and watch the recovered js update. notes flag what needs a human.
download the whole js source in one zip, same folder layout, .php swapped for .js.
adds let where a variable is born and hoists the ones php lets you set inside blocks.
concat dots, single quotes, "$interpolation", {$complex} and heredocs become clean template literals.
lists stay arrays, associative arrays become objects, $arr[] becomes push.
properties, constants, static methods, constructors, $this and parent:: all carry over.
mixed html and <?= ?> files work, including if: / endif; style blocks.
count, explode, array_filter, in_array, json_decode, intval and friends map to native js.
porter is rule based, so it hands you a solid first draft of your js source, not a magic button. database calls, sessions, sprintf, dates and file io get flagged for you to finish by hand.