Skip to content

Commit 401b9b9

Browse files
committed
Finalize implementation
1 parent c7edcf1 commit 401b9b9

File tree

6 files changed

+7
-134
lines changed

6 files changed

+7
-134
lines changed

Zend/zend.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
158158

159159
ZEND_INI_BEGIN()
160160
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
161-
STD_ZEND_INI_BOOLEAN("debug_locale_sensitive_float_casts", "0", ZEND_INI_ALL, OnUpdateBool, debug_locale_sensitive_float_casts, zend_executor_globals, executor_globals)
162161
STD_ZEND_INI_ENTRY("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
163162
ZEND_INI_ENTRY3_EX("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateGCEnabled, NULL, NULL, NULL, zend_gc_enabled_displayer_cb)
164163
STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool, multibyte, zend_compiler_globals, compiler_globals)

Zend/zend_globals.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ struct _zend_executor_globals {
237237
HashTable weakrefs;
238238

239239
zend_bool exception_ignore_args;
240-
zend_bool debug_locale_sensitive_float_casts;
241240

242241
zend_get_gc_buffer get_gc_buffer;
243242

Zend/zend_operators.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -642,15 +642,6 @@ ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op) /* {{{ */
642642

643643
str = zend_strpprintf_unchecked(0, "%.*H", (int) EG(precision), dval);
644644

645-
if (EG(debug_locale_sensitive_float_casts)) {
646-
zend_string *original_str = zend_strpprintf(0, "%.*G", (int) EG(precision), dval);
647-
648-
if (!zend_string_equals(str, original_str)) {
649-
zend_error(E_WARNING, "Locale-independent float to string conversion");
650-
}
651-
zend_string_release(original_str);
652-
}
653-
654645
ZVAL_NEW_STR(op, str);
655646
break;
656647
}
@@ -956,15 +947,6 @@ static zend_always_inline zend_string* __zval_get_string_func(zval *op, zend_boo
956947
case IS_DOUBLE: {
957948
zend_string *str = zend_strpprintf_unchecked(0, "%.*H", (int) EG(precision), Z_DVAL_P(op));
958949

959-
if (EG(debug_locale_sensitive_float_casts)) {
960-
zend_string *original_str = zend_strpprintf(0, "%.*G", (int) EG(precision), Z_DVAL_P(op));
961-
962-
if (!zend_string_equals(str, original_str)) {
963-
zend_error(E_WARNING, "Locale-independent float to string conversion");
964-
}
965-
zend_string_release(original_str);
966-
}
967-
968950
return str;
969951
}
970952
case IS_ARRAY:

ext/standard/tests/strings/locale_independent_float_to_string.phpt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
Test that floats are converted to string locale independently
33
--SKIPIF--
44
<?php
5+
56
if (!setlocale
67
(LC_ALL,
78
"german", "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8",
89
"french", "fr", "fr_FR", "fr_FR.ISO8859-1", "fr_FR.ISO_8859-1", "fr_FR.UTF-8",
910
)) {
10-
die("skip locale needed for this test is not supported on this platform");
11+
die("skip - locale needed for this test is not supported on this platform");
12+
}
13+
14+
if (!extension_loaded("json")) {
15+
print "skip - test requires the json extension";
1116
}
17+
1218
?>
1319
--FILE--
1420
<?php

ext/standard/tests/strings/locale_independent_float_to_string_debug_mode.phpt

Lines changed: 0 additions & 113 deletions
This file was deleted.

ext/standard/tests/strings/consistent_float_string_casts.phpt renamed to tests/basic/consistent_float_string_casts.phpt

File renamed without changes.

0 commit comments

Comments
 (0)