I'm writing an add-on and need to check the current EE version from PHP. What is the best way to get the current ExpressionEngine version?

2 Answers 2


One option would be to use the APP_VER constant. You can see it here with a few other version constants as well:


This will give you the version number with decimals unlike Adrian's solution so, pick which route you'd like. For example:

if (APP_VER == '2.5.3')
   do something;
  • 1
    Ha, I just realized it was you who asked this question! And yes I will sleep a little smarter tonight knowing I knew something you didn't ;)
    – Natetronn
    Commented Dec 16, 2012 at 2:46

You can use $this->EE->config->item('app_version') which returns a string like 253.

I'm not sure whether this is the most reliable way to determine the version number though, or whether it's possible to get the version number including decimals.

  • Your way is more reliable when you use this function in the custom add-on. Because if you use the APP_VER constant in the add-on code. If user upgrade the EE version with your add-on then they will get the error of the undefined constant. Commented May 22, 2021 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.