note 21862 deleted from function.version-compare by sniper

From: Date: Mon, 04 Aug 2003 14:16:55 +0000
Subject: note 21862 deleted from function.version-compare by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-53327@lists.php.net to get a copy of this message
Note Submitter: savetz@northcoast.com ---- If you wish to use a similar function before version 4.1.0, you can use the following: function minimum_version( $vercheck ) { $minver = explode(".", $vercheck); $curver = explode(".", phpversion()); if (($curver[0] < $minver[0]) || (($curver[0] == $minver[0]) && ($curver[1] < $minver[1])) || (($curver[0] == $minver[0]) && ($curver[1] == $minver[1]) && ($curver[2][0] < $minver[2][0]))) return false; else return true; } if (minimum_version("4.1.0")) { $issue = $_GET['issue']; } This is a good way to write code that works both before and after version 4.1.0, which changed how global predefined variables work.

« previous php.notes (#53327) next »