Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into str_size_and_int64
Browse files Browse the repository at this point in the history
* origin/master:
  Patches #67739
  PHP_INT_MIN and _MAX tests
  NEWS and UPGRADING
  Added PHP_INT_MIN

Conflicts:
	main/main.c
weltling committed Aug 4, 2014
2 parents 6162758 + eee0385 commit c3c83bb
Showing 5 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -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)

2 changes: 2 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
@@ -68,6 +68,8 @@ PHP X.Y UPGRADE NOTES
10. New Global Constants
========================================

- Core
, PHP_INT_MIN added.

========================================
11. Changes to INI File Handling
1 change: 1 addition & 0 deletions main/main.c
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions tests/lang/constants/PHP_INT_32bit.phpt
Original file line number Diff line number Diff line change
@@ -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)
17 changes: 17 additions & 0 deletions tests/lang/constants/PHP_INT_64bit.phpt
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit c3c83bb

Please sign in to comment.