Skip to content

Commit c3c83bb

Browse files
committed
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
2 parents 6162758 + eee0385 commit c3c83bb

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ PHP NEWS
77
(Adam)
88
. Update the MIME type list from the one shipped by Apache HTTPD. (Adam)
99

10+
- Core:
11+
. Added PHP_INT_MIN constant. (Andrea)
12+
1013
- DBA:
1114
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
1215

UPGRADING

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ PHP X.Y UPGRADE NOTES
6868
10. New Global Constants
6969
========================================
7070

71+
- Core
72+
, PHP_INT_MIN added.
7173

7274
========================================
7375
11. Changes to INI File Handling

main/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
21992199
REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS);
22002200
REGISTER_MAIN_INT_CONSTANT("PHP_MAXPATHLEN", MAXPATHLEN, CONST_PERSISTENT | CONST_CS);
22012201
REGISTER_MAIN_INT_CONSTANT("PHP_INT_MAX", PHP_INT_MAX, CONST_PERSISTENT | CONST_CS);
2202+
REGISTER_MAIN_INT_CONSTANT("PHP_INT_MIN", PHP_INT_MIN, CONST_PERSISTENT | CONST_CS);
22022203
REGISTER_MAIN_INT_CONSTANT("PHP_INT_SIZE", SIZEOF_ZEND_INT, CONST_PERSISTENT | CONST_CS);
22032204

22042205
#ifdef PHP_WIN32
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Test PHP_INT_MIN, PHP_INT_MAX and PHP_INT_SIZE (32-bit)
3+
--SKIPIF--
4+
<?php if (PHP_INT_SIZE !== 4)
5+
die("skip this test is for 32-bit platforms only"); ?>
6+
--FILE--
7+
<?php
8+
9+
var_dump(PHP_INT_MIN);
10+
var_dump(PHP_INT_MAX);
11+
var_dump(PHP_INT_SIZE);
12+
13+
?>
14+
--EXPECT--
15+
int(-2147483648)
16+
int(2147483647)
17+
int(4)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Test PHP_INT_MIN, PHP_INT_MAX and PHP_INT_SIZE (64-bit)
3+
--SKIPIF--
4+
<?php if (PHP_INT_SIZE !== 8)
5+
die("skip this test is for 64-bit platforms only"); ?>
6+
--FILE--
7+
<?php
8+
9+
var_dump(PHP_INT_MIN);
10+
var_dump(PHP_INT_MAX);
11+
var_dump(PHP_INT_SIZE);
12+
13+
?>
14+
--EXPECT--
15+
int(-9223372036854775808)
16+
int(9223372036854775807)
17+
int(8)

0 commit comments

Comments
 (0)