Function to check if running as root

Simple function that can be used to check if the current script is running as root:

<?php
/**
 * Function which returns true if the user running the script has root
 * privileges.
 *
 * @return boolean
 */
function checkRoot() {
  return posix_geteuid() === 0;
}

This is probably *nix only but may work with Cygwin on windows