PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Getting the Zend Framework Version

Zend_Version provides a class constant Zend_Version::VERSION that contains a string identifying the version number of your Zend Framework installation. Zend_Version::VERSION might contain "1.7.4", for example.

The static method Zend_Version::compareVersion($version) is based on the PHP function version_compare(). This method returns -1 if the specified version is older than the installed Zend Framework version, 0 if they are the same and +1 if the specified version is newer than the version of the Zend Framework installation.

Example 996. Example of the compareVersion() Method

<?php
// returns -1, 0 or 1
$cmp Zend_Version::compareVersion('2.0.0');

The static method Zend_Version::getLatest() provides the version number of the last stable release available for download on the site Zend Framework.

Example 997. Example of the getLatest() Method

<?php
// returns 1.11.0 (or a later version)
echo Zend_Version::getLatest();

Zend Framework