Skip to content

Instantly share code, notes, and snippets.

@joshkoenig
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshkoenig/6c3d7bbb164e2d13526d to your computer and use it in GitHub Desktop.
Save joshkoenig/6c3d7bbb164e2d13526d to your computer and use it in GitHub Desktop.
How to make people aware of why something might not work.
<?php
# Making use of: http://php.net/manual/en/function.phpversion.php
#
# The idea is you'd stick this in your core class at the top to prevent execution
# on out-dated runtime environments.
#
# You could use 50300 if you only care about 5.3, but it's EOL too, so...
if (!defined('PHP_VERSION_ID')) || PHP_VERSION_ID < 50400) {
# Inform users they need to upgrade their PHP version (or have their host do so)
# It'd be great if there was a common message or link to send users.
# Don't let anything else execute.
return;
}
# Your normal code starts here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment