-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Description
The following code:
<?php
declare(strict_types=1);
error_reporting(E_ALL & ~E_DEPRECATED); // same as error_reporting(E_ALL ^ E_DEPRECATED);
function implicitNullable1(string $foo = null) {}
trigger_error('random message1', E_USER_DEPRECATED);
error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); // same as error_reporting(E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED);
function implicitNullable2(string $foo = null) {}
trigger_error('random message2', E_USER_DEPRECATED);
Resulted in this output:
Deprecated: implicitNullable1(): Implicitly marking parameter $foo as nullable is deprecated, the explicit nullable type must be used instead in /in/0lbLD on line 7
Deprecated: implicitNullable2(): Implicitly marking parameter $foo as nullable is deprecated, the explicit nullable type must be used instead in /in/0lbLD on line 12
Deprecated: random message1 in /in/0lbLD on line 8
But I expected this output instead:
Deprecated: random message1 in /in/rrMGQ on line 8
Hi team!
After introducing new deprecation in PHP 8.4 https://wiki.php.net/rfc/deprecate-implicitly-nullable-types i receive similar messages on non-user deprecated functions in my project, but I am unable to silence them by using E_ALL & ~E_DEPRECATED
bitmask. I think this is a bug. Or I am wrong. Any solution ?
Thanks!
PHP Version
PHP 8.4.1
Operating System
Ubuntu
COil