Use PHP_OS instead of  variable to support cli.php (Contributed by rkaldung)