note 62691 rejected from function.phpversion by bjori

From: Date: Tue, 07 Mar 2006 13:43:42 +0000
Subject: note 62691 rejected from function.phpversion by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-104988@lists.php.net to get a copy of this message
Note Submitter: vorozhko at gmail dot com ---- check_version have a logical error in the last line - it must return false. New check_version function: # Compares versions of software # versions must must use the format ' x.y.z... ' # where (x, y, z) are numbers in [0-9] function check_version($currentversion, $requiredversion) { list($majorC, $minorC, $editC) = split('[/.-]', $currentversion); list($majorR, $minorR, $editR) = split('[/.-]', $requiredversion); if ($majorC > $majorR) return true; if ($majorC < $majorR) return false; // same major - check ninor if ($minorC > $minorR) return true; if ($minorC < $minorR) return false; // and same minor if ($editC >= $editR) return true; return false; } Yaroslav I. Vorozhko

« previous php.notes (#104988) next »