. If the array returned by __sleep() contains non-existing properties, these
are now silently ignored. Previously, such properties would have been
serialized as if they had the value NULL.
+ . The default locale on startup is now always "C". No locales are inherited
+ from the environment by default. Previously, LC_ALL was set to "C", while
+ LC_CTYPE was inherited from the environment. However, some functions did not
+ respect the inherited locale without an explicit setlocale() call. An
+ explicit setlocale() call is now always required if you wish to change any
+ locale component from the default.
- tidy:
. The $use_include_path parameter, which was not used internally, has been
--- /dev/null
+--TEST--
+Do not inherit LC_CTYPE from environment
+--SKIPIF--
+<?php
+if (!setlocale(LC_CTYPE, "de_DE", "de-DE")) die("skip requires de_DE locale");
+?>
+--ENV--
+LC_CTYPE=de_DE
+--FILE--
+<?php
+
+var_dump(setlocale(LC_CTYPE, "0"));
+var_dump(bin2hex(strtoupper("\xe4")));
+var_dump(preg_match('/\w/', "\xe4"));
+var_dump(setlocale(LC_CTYPE, "de_DE", "de-DE") !== false);
+var_dump(bin2hex(strtoupper("\xe4")));
+var_dump(preg_match('/\w/', "\xe4"));
+?>
+--EXPECT--
+string(1) "C"
+string(2) "e4"
+int(0)
+bool(true)
+string(2) "c4"
+int(1)
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include <locale.h>
#ifndef __P
#ifdef __GNUC__
le_snmp_session = zend_register_list_destructors_ex(php_snmp_session_destructor, NULL, PHP_SNMP_SESSION_RES_NAME, module_number);
init_snmp("snmpapp");
+ /* net-snmp corrupts the CTYPE locale during initialization. */
+ setlocale(LC_CTYPE, "C");
#ifdef NETSNMP_DS_LIB_DONT_PERSIST_STATE
/* Prevent update of the snmpapp.conf file */
* to the value in startup environment */
if (BG(locale_changed)) {
setlocale(LC_ALL, "C");
- setlocale(LC_CTYPE, "");
zend_update_current_locale();
if (BG(locale_string)) {
zend_string_release_ex(BG(locale_string), 0);
zuf.getenv_function = sapi_getenv;
zuf.resolve_path_function = php_resolve_path_for_zend;
zend_startup(&zuf);
- setlocale(LC_CTYPE, "");
zend_update_current_locale();
#if HAVE_TZSET