note 112131 added to function.phpversion

From: Date: Wed, 08 May 2013 08:45:13 +0000
Subject: note 112131 added to function.phpversion
Groups: php.notes 
Request: Send a blank email to php-notes+get-194735@lists.php.net to get a copy of this message
If you're trying to check whether the version of PHP you're running on is sufficient, don't screw around with strcasecmp etc. PHP already has a version_compare function, and it's specifically made to compare PHP-style version strings. <?php if (version_compare(phpversion(), '5.3.10', '<')) { // php version isn't high enough } ?> ---- Server IP: 69.147.83.199 Probable Submitter: 66.173.231.161 ---- Manual Page -- http://php.net/manual/en/function.phpversion.php Edit -- https://master.php.net/note/edit/112131 Del: integrated -- https://master.php.net/note/delete/112131/integrated Del: useless -- https://master.php.net/note/delete/112131/useless Del: bad code -- https://master.php.net/note/delete/112131/bad+code Del: spam -- https://master.php.net/note/delete/112131/spam Del: non-english -- https://master.php.net/note/delete/112131/non-english Del: in docs -- https://master.php.net/note/delete/112131/in+docs Del: other reasons-- https://master.php.net/note/delete/112131 Reject -- https://master.php.net/note/reject/112131 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194735) next »