summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rwxr-xr-xext/intl/php_intl.c4
-rw-r--r--ext/intl/tests/intl_icu_version_constant.phpt10
2 files changed, 14 insertions, 0 deletions
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index a9bfefd14c..1b2b0c69dc 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -543,6 +543,10 @@ PHP_MINIT_FUNCTION( intl )
REGISTER_INI_ENTRIES();
REGISTER_LONG_CONSTANT("INTL_MAX_LOCALE_LEN", INTL_MAX_LOCALE_LEN, CONST_CS);
+ REGISTER_STRING_CONSTANT("INTL_ICU_VERSION", U_ICU_VERSION, CONST_PERSISTENT | CONST_CS);
+#ifdef U_ICU_DATA_VERSION
+ REGISTER_STRING_CONSTANT("INTL_ICU_DATA_VERSION", U_ICU_DATA_VERSION, CONST_PERSISTENT | CONST_CS);
+#endif
/* Register 'Collator' PHP class */
collator_register_Collator_class( TSRMLS_C );
diff --git a/ext/intl/tests/intl_icu_version_constant.phpt b/ext/intl/tests/intl_icu_version_constant.phpt
new file mode 100644
index 0000000000..13160693c2
--- /dev/null
+++ b/ext/intl/tests/intl_icu_version_constant.phpt
@@ -0,0 +1,10 @@
+--TEST--
+INTL_ICU_VERSION constant
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+var_dump(defined("INTL_ICU_VERSION"));
+?>
+--EXPECT--
+bool(true)