note 118199 deleted from function.setlocale by cmb

From: Date: Wed, 16 Dec 2015 15:51:34 +0000
Subject: note 118199 deleted from function.setlocale by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-204412@lists.php.net to get a copy of this message
Note Submitter: internationalist ---- 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 ?>

« previous php.notes (#204412) next »