summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-04 10:34:07 +0200
committerAnatol Belski <ab@php.net>2014-08-04 10:34:07 +0200
commitc3c83bb078797b5cbb747af063229805a902d50a (patch)
treee5aee2a30fbf68da414c5cdb08b2159517109288
parent616275859e2b195e0ea8e90a26a0ed8801a80765 (diff)
parenteee03852b655368de51b9319677d02c0187e6fe6 (diff)
downloadphp-git-c3c83bb078797b5cbb747af063229805a902d50a.tar.gz
Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master: Patches #67739 PHP_INT_MIN and _MAX tests NEWS and UPGRADING Added PHP_INT_MIN Conflicts: main/main.c
-rw-r--r--NEWS3
-rw-r--r--UPGRADING2
-rw-r--r--main/main.c1
-rw-r--r--tests/lang/constants/PHP_INT_32bit.phpt17
-rw-r--r--tests/lang/constants/PHP_INT_64bit.phpt17
5 files changed, 40 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 1badfb8579..c19097337a 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ PHP NEWS
(Adam)
. Update the MIME type list from the one shipped by Apache HTTPD. (Adam)
+- Core:
+ . Added PHP_INT_MIN constant. (Andrea)
+
- DBA:
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
diff --git a/UPGRADING b/UPGRADING
index 740047a86a..730fa5bd87 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -68,6 +68,8 @@ PHP X.Y UPGRADE NOTES
10. New Global Constants
========================================
+- Core
+ , PHP_INT_MIN added.
========================================
11. Changes to INI File Handling
diff --git a/main/main.c b/main/main.c
index efa3583065..c00a246059 100644
--- a/main/main.c
+++ b/main/main.c
@@ -2199,6 +2199,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("PHP_MAXPATHLEN", MAXPATHLEN, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("PHP_INT_MAX", PHP_INT_MAX, CONST_PERSISTENT | CONST_CS);
+ REGISTER_MAIN_INT_CONSTANT("PHP_INT_MIN", PHP_INT_MIN, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_INT_CONSTANT("PHP_INT_SIZE", SIZEOF_ZEND_INT, CONST_PERSISTENT | CONST_CS);
#ifdef PHP_WIN32
diff --git a/tests/lang/constants/PHP_INT_32bit.phpt b/tests/lang/constants/PHP_INT_32bit.phpt
new file mode 100644
index 0000000000..0c85d9719b
--- /dev/null
+++ b/tests/lang/constants/PHP_INT_32bit.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Test PHP_INT_MIN, PHP_INT_MAX and PHP_INT_SIZE (32-bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 4)
+ die("skip this test is for 32-bit platforms only"); ?>
+--FILE--
+<?php
+
+var_dump(PHP_INT_MIN);
+var_dump(PHP_INT_MAX);
+var_dump(PHP_INT_SIZE);
+
+?>
+--EXPECT--
+int(-2147483648)
+int(2147483647)
+int(4) \ No newline at end of file
diff --git a/tests/lang/constants/PHP_INT_64bit.phpt b/tests/lang/constants/PHP_INT_64bit.phpt
new file mode 100644
index 0000000000..4b7da3a3e9
--- /dev/null
+++ b/tests/lang/constants/PHP_INT_64bit.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Test PHP_INT_MIN, PHP_INT_MAX and PHP_INT_SIZE (64-bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE !== 8)
+ die("skip this test is for 64-bit platforms only"); ?>
+--FILE--
+<?php
+
+var_dump(PHP_INT_MIN);
+var_dump(PHP_INT_MAX);
+var_dump(PHP_INT_SIZE);
+
+?>
+--EXPECT--
+int(-9223372036854775808)
+int(9223372036854775807)
+int(8) \ No newline at end of file