Leetcode Javascript Class Constructor Function In Php