Test your code with this tester:
Run result:
This script works with a whitelist of functions. All functions that do not require disk, system or network access are whitelisted, others blacklisted. Max execution time is set to 5 seconds. If you find a disabled function that should be whitelisted or if you run into other problems, please write me