note 118200 added to function.setlocale

From: Date: Sun, 25 Oct 2015 02:14:20 +0000
Subject: note 118200 added to function.setlocale
Groups: php.notes 
Request: Send a blank email to php-notes+get-204018@lists.php.net to get a copy of this message
My script runs a loop that changes the locale (multilingual application). I've noticed that on some random occasion the locale still hasn't changed despite the setlocale() function being executed a step earlier. I had to add wait time for this condition. Interestingly enough, this was the case only with the 'nl_NL.UTF8' locale. <?php //some code $this->counter = 0; // some code $this->locale = 'nl_NL.UTF8'; setlocale(LC_ALL, $this->locale); $this->counter++; if ($this->locale !== setlocale(LC_CTYPE, 0)) { // Locale not changed yet. if ($this->counter > 10) { return; } sleep(1); } // some code ?> ---- Server IP: 72.52.91.14 Probable Submitter: 219.78.44.92 ---- Manual Page -- http://php.net/manual/en/function.setlocale.php Edit -- https://master.php.net/note/edit/118200 Del: integrated -- https://master.php.net/note/delete/118200/integrated Del: useless -- https://master.php.net/note/delete/118200/useless Del: bad code -- https://master.php.net/note/delete/118200/bad+code Del: spam -- https://master.php.net/note/delete/118200/spam Del: non-english -- https://master.php.net/note/delete/118200/non-english Del: in docs -- https://master.php.net/note/delete/118200/in+docs Del: other reasons-- https://master.php.net/note/delete/118200 Reject -- https://master.php.net/note/reject/118200 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204018) next »