While PHP is not my goto language.. and the language has likely changed a fair bit when I last used it.. I don't think the issue is PHP.