It depends on the version of PHP you have installed. You can at least supress these errors with:
or you can go through and fix the errors in the copy of the API you have. There were similar warnings generated for the past few versions.
the versions of PHP have also changed (a lot) over the years. php.net will often list functions and the correct versions. and if deprecated, will list the current functions that replace the old ones.
that's the web developers life: change is inevitable!
I added your code to the top of the page and it worked!!
Also, since your solution spans multiple versions of FM, I always remind people to make sure they have the matching API code (in this case, for FM 13) installed.
the solution is running on FM Server 13 now. I did the standard install of FM Server 13 so i assume it installed the correct PHP API.