Switching from node to PHP