JavaScript to PHP source transformation