mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Deprecate imap NIL constant
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
This commit is contained in:
parent
f0b190c32d
commit
2bc23cc6e3
4 changed files with 17 additions and 2 deletions
|
@ -350,6 +350,10 @@ PHP 8.1 UPGRADE NOTES
|
|||
instead.
|
||||
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:
|
||||
. Calling IntlCalendar::roll() with bool argument is deprecated. Pass 1 and -1
|
||||
instead of true and false respectively.
|
||||
|
|
|
@ -491,7 +491,7 @@ PHP_MINIT_FUNCTION(imap)
|
|||
imap_object_handlers.clone_obj = NULL;
|
||||
|
||||
/* 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 */
|
||||
mail_parameters(NIL, SET_GETS, (void *) NIL);
|
||||
|
|
|
@ -23,7 +23,7 @@ try {
|
|||
}
|
||||
|
||||
try {
|
||||
imap_open('', '', '', NIL, -1);
|
||||
imap_open('', '', '', 0, -1);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
|
11
ext/imap/tests/nil_constant.phpt
Normal file
11
ext/imap/tests/nil_constant.phpt
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue