Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-07 Thread Sergii Shymko
From: Olle Härstedt Sent: Tuesday, February 7, 2023 11:53 AM To: Rowan Tommins Cc: PHP Internals Subject: Re: [PHP-DEV] RFC Proposal - Types for Inline Variables 2023-02-07 17:21 GMT+01:00, Rowan Tommins : > On 07/02/2023 14:07, Olle Härstedt wrote: >> It shou

Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-07 Thread Mark Baker
On 07/02/2023 20:53, Olle Härstedt wrote: No not really. I'd expect it behave similar to function argument type-hinting in PHP, that is, runtime checks, but where the notation can be used by external tools. The big difference is that the current checking for function arguments is only necessar

Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-07 Thread Olle Härstedt
2023-02-07 17:21 GMT+01:00, Rowan Tommins : > On 07/02/2023 14:07, Olle Härstedt wrote: >> It should perhaps be mentioned that analyzers can use type annotations >> during their process, instead of the more clunky /** @var string */ or >> similar you have to use today for local variables. > > This

Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-07 Thread Rowan Tommins
On 07/02/2023 14:07, Olle Härstedt wrote: It should perhaps be mentioned that analyzers can use type annotations during their process, instead of the more clunky /** @var string */ or similar you have to use today for local variables. This sounds like you're reaching for Python's approach, whe

Re: [PHP-DEV] Deprecate ldap_connect with host and port as separate arguments

2023-02-07 Thread G. P. B.
On Tue, 7 Feb 2023 at 12:56, Côme Chilliet wrote: > Le vendredi 27 janvier 2023, 10:00:35 CET Andreas Heigl a écrit : > > Hey Folks. > > > > I think it would be a good idea to deprecate calling ldap_connect with 2 > > parameters host and port. > > Hello, > > My long term plan was to replace it by

Re: [PHP-DEV] Deprecate ldap_connect with host and port as separate arguments

2023-02-07 Thread Côme Chilliet
Le vendredi 27 janvier 2023, 10:00:35 CET Andreas Heigl a écrit : > Hey Folks. > > I think it would be a good idea to deprecate calling ldap_connect with 2 > parameters host and port. Hello, My long term plan was to replace it by a constructor for the new \LDAP\Connection class that only accep

Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-07 Thread Rowan Tommins
On 06/02/2023 21:15, someniatko wrote: Can you describe some use cases where this feature will be useful? I see it's coming from statically typed / compiled languages like C++, but in such languages compiler must know variable type in order to manage memory properly. As PHP is an interpreted lan

Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-07 Thread Wendell Adriel
Hey, thanks for the feedback Illia and Hans. Illia, I think that the main motivation for having the support of typing inline variables is that with that we can have more safety in the code. The code can be more shielded from bugs and easier to maintain. I don't dislike the idea of having so

Re: [PHP-DEV] [RFC] [Vote] Readonly amendments

2023-02-07 Thread Máté Kocsis
Hi Everyone, The vote for the "Readonly amendments" RFC is closed with the following results: Proposal #1 (Non-readonly classes can extend readonly classes): The proposal was declined with 7 yes and 12 no votes (37%). Proposal #2 (Readonly properties can be reinitialized during cloning): The pro

Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-07 Thread Hans Henrik Bergan
function f(int $value){ $value="foo"; // should this be a TypeError? BC break all the things } On Mon, 6 Feb 2023 at 22:15, someniatko wrote: > > Hi there, > > I am not a core PHP language developer, just a regular PHP programmer, and > cannot speak for the whole community, so I'll just share