Deprecate imap NIL constant

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
This commit is contained in:
Nikita Popov 2021-07-08 16:03:47 +02:00
parent f0b190c32d
commit 2bc23cc6e3
4 changed files with 17 additions and 2 deletions

View file

@ -350,6 +350,10 @@ PHP 8.1 UPGRADE NOTES
instead. instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_1 RFC: https://wiki.php.net/rfc/deprecations_php_8_1
- IMAP:
. The NIL constant has been deprecated. Use 0 instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
- Intl: - Intl:
. Calling IntlCalendar::roll() with bool argument is deprecated. Pass 1 and -1 . Calling IntlCalendar::roll() with bool argument is deprecated. Pass 1 and -1
instead of true and false respectively. instead of true and false respectively.

View file

@ -491,7 +491,7 @@ PHP_MINIT_FUNCTION(imap)
imap_object_handlers.clone_obj = NULL; imap_object_handlers.clone_obj = NULL;
/* lets allow NIL */ /* lets allow NIL */
REGISTER_LONG_CONSTANT("NIL", NIL, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("NIL", NIL, CONST_PERSISTENT | CONST_CS | CONST_DEPRECATED);
/* plug in our gets */ /* plug in our gets */
mail_parameters(NIL, SET_GETS, (void *) NIL); mail_parameters(NIL, SET_GETS, (void *) NIL);

View file

@ -23,7 +23,7 @@ try {
} }
try { try {
imap_open('', '', '', NIL, -1); imap_open('', '', '', 0, -1);
} catch (\ValueError $e) { } catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }

View file

@ -0,0 +1,11 @@
--TEST--
NIL constant is deprecated
--EXTENSIONS--
imap
--FILE--
<?php
var_dump(NIL);
?>
--EXPECTF--
Deprecated: Constant NIL is deprecated in %s on line %d
int(0)