diff options
author | Anatol Belski <ab@php.net> | 2016-04-08 09:55:57 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-04-08 09:55:57 +0200 |
commit | 93f8eaf3b8c9400f230dc904d52508882f83ee5f (patch) | |
tree | ae71e7478fa6ca69610a6d029c7cb907df25fb01 | |
parent | f042c5f72644cc5817189718928f1cdead0ebedf (diff) | |
download | php-git-93f8eaf3b8c9400f230dc904d52508882f83ee5f.tar.gz |
Fixed bug #70455 Missing constant: IntlChar::NO_NUMERIC_VALUE
-rw-r--r-- | ext/intl/uchar/tests/bug70455.phpt | 13 | ||||
-rw-r--r-- | ext/intl/uchar/uchar.c | 1 |
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, |