Added a debug function to match the php version