PHP_VERSION_ID for versions < 50207


/ Published in: PHP
Save to your folder(s)

Works fine with version strings like "5.2.6-1+lenny8", also on PHP4 but it's not tested.


Copy this code and paste it in your HTML
  1. <?php
  2. declare (encoding='utf8');
  3.  
  4.  
  5.  
  6. if (!defined ('PHP_VERSION_ID'))
  7. {
  8. $ver = array_map ('intval', explode ('.', PHP_VERSION, 3));
  9. $ver[0] *= 10000;
  10. $ver[1] *= 100;
  11. define ('PHP_VERSION_ID', array_sum ($ver));
  12. unset ($ver);
  13. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.