summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-04-08 09:55:57 +0200
committerAnatol Belski <ab@php.net>2016-04-08 09:55:57 +0200
commit93f8eaf3b8c9400f230dc904d52508882f83ee5f (patch)
treeae71e7478fa6ca69610a6d029c7cb907df25fb01
parentf042c5f72644cc5817189718928f1cdead0ebedf (diff)
downloadphp-git-93f8eaf3b8c9400f230dc904d52508882f83ee5f.tar.gz
Fixed bug #70455 Missing constant: IntlChar::NO_NUMERIC_VALUE
-rw-r--r--ext/intl/uchar/tests/bug70455.phpt13
-rw-r--r--ext/intl/uchar/uchar.c1
2 files changed, 14 insertions, 0 deletions
diff --git a/ext/intl/uchar/tests/bug70455.phpt b/ext/intl/uchar/tests/bug70455.phpt
new file mode 100644
index 0000000000..00ee8984a0
--- /dev/null
+++ b/ext/intl/uchar/tests/bug70455.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #70455 Missing constant: IntlChar::NO_NUMERIC_VALUE
+--SKIPIF--
+<?php if (!extension_loaded('intl')) die("skip requires ext/intl") ?>
+--FILE--
+<?php
+$value = IntlChar::getNumericValue("x");
+var_dump($value);
+var_dump($value === IntlChar::NO_NUMERIC_VALUE);
+?>
+--EXPECT--
+float(-123456789)
+bool(true)
diff --git a/ext/intl/uchar/uchar.c b/ext/intl/uchar/uchar.c
index 8fb09f9f82..755a6c9acb 100644
--- a/ext/intl/uchar/uchar.c
+++ b/ext/intl/uchar/uchar.c
@@ -737,6 +737,7 @@ int php_uchar_minit(INIT_FUNC_ARGS) {
IC_CONSTL("CODEPOINT_MAX", UCHAR_MAX_VALUE)
IC_CONSTL("FOLD_CASE_DEFAULT", U_FOLD_CASE_DEFAULT)
IC_CONSTL("FOLD_CASE_EXCLUDE_SPECIAL_I", U_FOLD_CASE_EXCLUDE_SPECIAL_I)
+ zend_declare_class_constant_double(ce, "NO_NUMERIC_VALUE", sizeof("NO_NUMERIC_VALUE")-1, U_NO_NUMERIC_VALUE);
/* All enums used by the uchar APIs. There are a LOT of them,
* so they're separated out into include files,