note 104598 added to function.version-compare

From: Date: Fri, 24 Jun 2011 19:07:47 +0000
Subject: note 104598 added to function.version-compare
Groups: php.notes 
Request: Send a blank email to php-notes+get-180931@lists.php.net to get a copy of this message
I know I'm splitting hairs here, but if you're OCD like me (version_compare(PHP_VERSION, '5.3.0') >= 0) is about 13% faster than (version_compare(PHP_VERSION, '5.3.0', '>=') <?php $count = 200000; $start = microtime(true); for($i=0;$i<$count;$i++) (version_compare(PHP_VERSION, '5.3.0') >= 0); echo "Real Operator: ".(microtime(true) - $start)."\n"; $start = microtime(true); for($i=0;$i<$count;$i++) (version_compare(PHP_VERSION, '5.3.0', '>=')); echo "String Operator: ".(microtime(true) - $start)."\n"; ?> ---- Server IP: 64.71.164.2 Probable Submitter: 99.9.85.218 ---- Manual Page -- http://www.php.net/manual/en/function.version-compare.php Edit -- https://master.php.net/note/edit/104598 Del: integrated -- https://master.php.net/note/delete/104598/integrated Del: useless -- https://master.php.net/note/delete/104598/useless Del: bad code -- https://master.php.net/note/delete/104598/bad+code Del: spam -- https://master.php.net/note/delete/104598/spam Del: non-english -- https://master.php.net/note/delete/104598/non-english Del: in docs -- https://master.php.net/note/delete/104598/in+docs Del: other reasons-- https://master.php.net/note/delete/104598 Reject -- https://master.php.net/note/reject/104598 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180931) next »