diff --git a/lib/SimpleSAML/Utils/System.php b/lib/SimpleSAML/Utils/System.php
index 61e6bfe7e63d3aebfa742356dd8755efcf6ad3b5..689dcf08df0dd8b8c67c8d2a599b300ae9cad41b 100644
--- a/lib/SimpleSAML/Utils/System.php
+++ b/lib/SimpleSAML/Utils/System.php
@@ -31,12 +31,12 @@ class System
         if (stristr(PHP_OS, 'LINUX')) {
             return self::LINUX;
         }
-        if (stristr(PHP_OS, 'WIN')) {
-            return self::WINDOWS;
-        }
         if (stristr(PHP_OS, 'DARWIN')) {
             return self::OSX;
         }
+        if (stristr(PHP_OS, 'WIN')) {
+            return self::WINDOWS;
+        }
         if (stristr(PHP_OS, 'BSD')) {
             return self::BSD;
         }