RE: [PHP-DEV] Warn when declaring required parameter after optionalone

2020-01-11 Thread Olumide Samson
Should it be a warning or an error?
---
Sent from Mail for Windows 10

From: Niklas Keller
Sent: Saturday, January 11, 2020 2:35 PM
To: Nikita Popov
Cc: Bob Weinand; PHP internals
Subject: Re: [PHP-DEV] Warn when declaring required parameter after optionalone

Hi Nikita,

while this is a rather small change, it has quite some BC impact, as
not all old code has been adjusted to run on PHP 7.1+ only using
nullable types.

I'd like to see an RFC with a vote for this.

Regards,
Niklas

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Warn when declaring required parameter after optionalone

2020-01-09 Thread Gert
> I could understand a warning or deprecation in a minor release, but as
there's already so many engine level exceptions landing in 8.0, I think
it makes sense to throw this on the pile as well to be swept up in the
same pass of migrations that people do in preperation for 8.0.

If this would've generated a warning in 7.4 then making this a compile
time error is acceptable.
But going from nothing to an error without any kind of warning makes
the upgrade harder than it needs to be.
I think this should be a warning, and then an exception in 9.0. Unless
there is gonna be a PHP 7.5
where only deprecations get added, in that case an error in 8.0 would be fine.

--
Gert

On Thu, 9 Jan 2020 at 15:06, Mark Randall  wrote:
>
> On 09/01/2020 12:31, Sebastian Bergmann wrote:
> > I would prefer erroring out over just emitting a warning.
>
> I'm in agreement with Sebastian, a compile time error is the way to go.
>
> I could understand a warning or deprecation in a minor release, but as
> there's already so many engine level exceptions landing in 8.0, I think
> it makes sense to throw this on the pile as well to be swept up in the
> same pass of migrations that people do in preperation for 8.0.
>
> Better to get the pain over and done with, rather than drag it out over
> multiple versions, as I'd guess that even if it was a warning now, it
> would end up a compile error a few years from now.
>
> --
> Mark Randall
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Warn when declaring required parameter after optionalone

2020-01-09 Thread Mark Randall

On 09/01/2020 12:31, Sebastian Bergmann wrote:

I would prefer erroring out over just emitting a warning.


I'm in agreement with Sebastian, a compile time error is the way to go.

I could understand a warning or deprecation in a minor release, but as 
there's already so many engine level exceptions landing in 8.0, I think 
it makes sense to throw this on the pile as well to be swept up in the 
same pass of migrations that people do in preperation for 8.0.


Better to get the pain over and done with, rather than drag it out over 
multiple versions, as I'd guess that even if it was a warning now, it 
would end up a compile error a few years from now.


--
Mark Randall

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php