]> granicus.if.org Git - php/commitdiff
- Use new setlocal semantics
authorDerick Rethans <derick@php.net>
Wed, 23 Oct 2002 20:35:16 +0000 (20:35 +0000)
committerDerick Rethans <derick@php.net>
Wed, 23 Oct 2002 20:35:16 +0000 (20:35 +0000)
tests/lang/034.phpt

index dbdcce1ccf59f101c21af97c4695f9dd94c42f91..9b10603c83b529669aaa0dca131e45e4927c33ce 100644 (file)
@@ -2,25 +2,16 @@
 Locale settings affecting float parsing
 --SKIPIF--
 <?php  # try to activate a german locale
-$status = false;
-foreach(array("de_DE", "de", "german", "ge") as $lang) {
-  if($lang == setlocale(LC_NUMERIC, $lang)) {
-         $status = true; 
-       continue;
-  }
+if (setlocale(LC_NUMERIC, "de_DE", "de", "german", "ge") === FALSE) {
+       print "skip";
 }
-if(!$status) print "skip";
 ?>
 --POST--
 --GET--
 --FILE--
 <?php 
-# try to activate a german locale
-foreach(array("de_DE", "de", "german", "ge") as $lang) {
-  if($lang == setlocale(LC_NUMERIC, $lang)) {
-         continue;
-  }
-}
+# activate the german locale
+setlocale(LC_NUMERIC, "de_DE", "de", "german", "ge");
 
 echo (float)"3.14", "\n";