[php-src] Issue #8024: No deprecation warning is triggered for nullable optional parameters before required ones

From: Date: Thu, 03 Feb 2022 15:51:50 +0000
Subject: [php-src] Issue #8024: No deprecation warning is triggered for nullable optional parameters before required ones
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239450@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8024 Comment Author: m-vo @iluuu1994 Thanks for the detailed background information! I wasn't aware that there is actually a difference between ?Type $foo = null and Type $foo = null, I always thought they are synonyms. @nikic pointed the following out in https://github.com/php/php-src/pull/5067#issuecomment-573872903: > function test($param = null, $param2) is strictly equivalent to function test($param, $param2). > You can just drop the useless and confusing = null, there are no BC implications whatsoever for that > case. This makes sense to me, but maybe then there is a point in deprecating this behavior altogether (the "confusing = null"), because it's likely a bug now. I fear I'm not deep enough in the PHP internals to judge about implications or to go through a RFC process, though.

« previous php.bugs (#239450) next »