Re: [PHP-DEV] [RFC] Partial Function Application v2

2025-06-28 Thread Eugene Sidelnyk
On Sat, Jun 28, 2025, 8:07 AM Larry Garfield wrote: > Hi folks. Arnaud and I would like to present take-2 at Partial Function > Application. > > https://wiki.php.net/rfc/partial_function_application_v2 > > It is largely similar to the previous PFA proposal from 2021, though there > are a number

Re: [PHP-DEV] Usable classes?

2025-04-01 Thread Eugene Sidelnyk
> > The wording “spicy”, “heretical”, “literally unusable”, “vibe”, the use > of ChatGPT, and the current calendar date requires me to ask: > Actually, if we put aside all of this, and think about it more seriously, personally I myself find it somewhat tedious to have every class have interface fo

Re: [PHP-DEV] [RFC] [Discussion] Never parameters

2025-03-11 Thread Eugene Sidelnyk
> Hi internals, > > I'd like to start discussion on a new RFC about allowing `never` for > parameter types when declaring a method. > At first signature seemed somewhat confusing to me, but now it makes perfect sense. Type-wise, about LSP, I find it logical that more concrete implementations cou

Re: [PHP-DEV] PHP True Async RFC

2025-03-08 Thread Eugene Sidelnyk
> > Yes, that is much much nicer! It feel familiar to go: > > go file_get_contents($file[$i]) > > And yes, I realize that would be a fun error in go, but you get the gist. > > — Rob > Yes, that's the point that we don't bother client code with any of the async stuff 🙂 If we want to create "async

Re: [PHP-DEV] PHP True Async RFC

2025-03-08 Thread Eugene Sidelnyk
> > wrap it in a specific form (async\run or async\async, in this RFC), which > ironically colors the function. > It doesn't color the function. The function is unchanged. Any existing function in userland do not have to be changed in any way. It's calls do not have to be rewritten into await, an

Re: [PHP-DEV] PHP True Async RFC

2025-03-08 Thread Eugene Sidelnyk
> > > The uncoloring of functions in PHP is probably one of the most annoying > aspects of fibers, IMHO. It's hard to explain unless you've been using them > awhile. But, with colored functions, the caller has control over when the > result is waiting on -- it could be now, it could be in a totally

Re: [PHP-DEV] PHP True Async RFC

2025-03-04 Thread Eugene Sidelnyk
Hi there, I would also like to highlight some interesting ideas that I find being useful to consider. Recently Bend programming language has been released, and it incorporates a completely different view on the conception of "code", in the definition of "what it is" and "how it should be interpre

Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard])

2025-02-13 Thread Eugene Sidelnyk
Hello, everyone I'm just wondering how the new attribute that defines behavior (not just additional metadata) will fit into the rest of the system. Right now, return type hints are not implemented just as an attribute, but as "native" type declaration. I mean, what we have right now: function f

Re: [PHP-DEV] Introduction - Sam Lewis

2025-02-08 Thread Eugene Sidelnyk
Hi Sam, Tim, Rob Maybe there could be another good feature to start with - the function to format bytes into a human-readable format (for debug purpuses) to have pretty view of the size (like 1.5GB, or 20MB) Right now every time I need this, I find myself copying the function from stack overflow,

Re: [PHP-DEV] [RFC] Pipe Operator (again)

2025-02-06 Thread Eugene Sidelnyk
Hi, Larry, That's super! I hope it will pass! Oladoyinbo, IMO the way it is described right now (e.g. explicit closures) is much more elegant than a new way of doing things that's not so obvious and will be necessary to keep in mind and support anyway. If it'd be necessary to simplify the stuff,

[PHP-DEV] iterator_count signature for iterables

2024-11-26 Thread Eugene Sidelnyk
Hello internals! Currently, iterator_count has the following signature: iterator_count(Traversable|array $iterator): int If we try to use iterable type and pass it to iterator_count function, we'd get following static analysis error: Argument 1 of iterator_count expects Traversable|array, but

Re: [PHP-DEV] [RFC] Data Classes

2024-11-23 Thread Eugene Sidelnyk
Hello If I remember correctly, the whole concept of "value" is fully described in DDD book by Eric Evans. If that's the point of the RFC, I wonder of there's any point in not making such classes immutable by default, and to keep only one instance of value object unique per given set of properties

Re: [PHP-DEV] Local constants

2024-09-04 Thread Eugene Sidelnyk
> Hello internals! > > I was wondering, has there been any discussion about supporting local > constants (variables that cannot be reassigned, perhaps even function > parameters)? > As for me, I would've hoped that there were local constants in PHP and I'd want to provide some thoughts on this reg

Re: [PHP-DEV] String enums & __toString()

2024-08-16 Thread Eugene Sidelnyk
> > Didja really? > > https://wiki.php.net/rfc/auto-implement_stringable_for_string_backed_enums Why has it been withdrawn?

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-20 Thread Eugene Sidelnyk
You won't believe it, but just right now I've been thinking about that it would be a wonderful feature for PHP to have some kind of type-tests (like `$a is Foo&Bar` or `$b is Foo|Baz|null`), and here you write out this email. I didn't read the whole RFC, but I'd like to say that having at least af

Re: [PHP-DEV] [PDO] 2 phase commit

2023-12-01 Thread Eugene Sidelnyk
One thing I'd like to point out is regarding second phase (commit phase) It's important to understand that once this phase has started, there's no way back. After code execution is behind commit point, the transactions MUST commit no matter what. Data must be committed regardless of network issues

Re: [PHP-DEV] [PDO] 2 phase commit

2023-11-30 Thread Eugene Sidelnyk
Hi there, This functionality is common for data intensive applications that leverage distributed systems for coping with load. In other words, having it at core level is desirable for enterprise-level systems. Ordinary web-sites are unlikely to use this feature. Though, I'd highly appreciate it

[PHP-DEV] First class callable syntax for instance methods

2023-04-12 Thread Eugene Sidelnyk
Hello, internals! I just want to share some thoughts with you regarding what could be improved in the first class callable syntax. It is already possible to create Callable from a static method: ``` class Foo { public static function staticmethod() {} } $c = Foo::staticmethod(...); ``` It would

Re: [PHP-DEV] First-class callable partial application

2023-03-15 Thread Eugene Sidelnyk
On Tue, Mar 14, 2023 at 12:39 PM Bob Weinand wrote: > > > Am 14.03.2023 um 10:16 schrieb Rowan Tommins : > > > > On 13/03/2023 20:44, Larry Garfield wrote: > >> As has been discussed numerous times, all of the most used array > functions need to be redesigned to work with iterables, and in many

Re: [PHP-DEV] First-class callable partial application

2023-03-10 Thread Eugene Sidelnyk
n Fri, Mar 10, 2023, 9:53 PM Larry Garfield wrote: > On Fri, Mar 10, 2023, at 1:04 PM, Eugene Sidelnyk wrote: > > Hello internals! > > I'm just wondering why First class callable syntax doesn't allow partial > > application? > > Recently I stumbled across f

Re: [PHP-DEV] RFC: code optimizations

2023-03-10 Thread Eugene Sidelnyk
Seems Uncle Bob with his boy scout rule left the room... On Fri, Mar 10, 2023, 2:19 PM Max Kellermann wrote: > On 2023/03/01 13:15, Max Kellermann wrote: > > IMO this is a bug in the process, and I'm trying to fix it. It should > > be allowed to merge small incremental improvements without a d

[PHP-DEV] First-class callable partial application

2023-03-10 Thread Eugene Sidelnyk
Hello internals! I'm just wondering why First class callable syntax doesn't allow partial application? Recently I stumbled across following scenario where it could be really useful: ``` public function __invoke(SendOtpCommand $command) { $this->cache->get($command->getPhone(), $thi

Re: [PHP-DEV] Union type casts

2022-10-05 Thread Eugene Sidelnyk
I used to have an awkward feeling when it was necessary to convert the nullable integer into a nullable string. It would be kind of ternary operator anyway. Either `$b = (null !== $a) ? (string)$a : null;` or `$b = (string)$a ?: null;`. A lot easier to read would it be if written this way: `$b = (

Re: [PHP-DEV] Union type casts

2022-10-04 Thread Eugene Sidelnyk
t 4, 2022, at 21:46, Eugene Sidelnyk wrote: > >$foo = (int|float)$bar; > > As written, I wouldn't know what to expect this to do with a string value > -- would it cast it to int or float? > > Based on the behavior of your second example, the answer appears to be > &qu

[PHP-DEV] Union type casts

2022-10-04 Thread Eugene Sidelnyk
Hello internals! I'm wondering if there are any plans for union type casts support. That's basically what I mean: ```php function checkItOut(int|float|string $bar) { $foo = (int|float)$bar; var_dump($foo); } ``` I assume the behavior should be the same as if we called the function havin

[PHP-DEV] Re: str_repeat performance

2022-09-10 Thread Eugene Sidelnyk
Oh, yes. Sorry for that. Thanks for pointing out. On Sat, Sep 10, 2022 at 3:23 PM Christoph M. Becker wrote: > On 10.09.2022 at 14:19, Eugene Sidelnyk wrote: > > > I have noted some strange points about `str_repeat` performance. It looks > > like the lesser `$times` argument

[PHP-DEV] str_repeat performance

2022-09-10 Thread Eugene Sidelnyk
Hello internals! I have noted some strange points about `str_repeat` performance. It looks like the lesser `$times` argument is, the bigger is execution time (only if we consider big numbers). For example, `str_repeat('%d ', 12500);` is a lot slower than `str_repeat('%d ', 125)`. First case

Re: [PHP-DEV] Nullsafe array access can still emit a warning

2022-08-24 Thread Eugene Sidelnyk
I completely agree with Marco. We should not mix up nullsafe operator with array access. As for me, aforementioned code works as expected. As an improvement, we can think of access-safe operator (like `$arr[?0]`), however I'm not sure if introduction of such will make sense. Regards Yevhen On We

Re: [PHP-DEV] [RFC] Disjunctive Normal Form Types

2022-03-19 Thread Eugene Sidelnyk
Looks very interesting, and most importantly, useful. On Sat, Mar 19, 2022 at 6:38 PM G. P. B. wrote: > Hello internals, > > I would like to open the discussion on the Disjunctive Normal Form (DNF) > types RFC: > https://wiki.php.net/rfc/dnf_types > > The implementation for it is available on my

Re: [PHP-DEV] PHP Community to support Ukraine and help to stop Russian agression

2022-03-03 Thread Eugene Sidelnyk
ow you are trying to help whatever you think you can help. By "you" I mean PHP community. On Thu, Mar 3, 2022, 11:46 PM Kalle Sommer Nielsen wrote: > Den tor. 3. mar. 2022 kl. 20.29 skrev Eugene Sidelnyk >: > > > > BTW, regarding symfony and banner, it doesn'

Re: [PHP-DEV] PHP Community to support Ukraine and help to stop Russian agression

2022-03-03 Thread Eugene Sidelnyk
BTW, regarding symfony and banner, it doesn't seem to have many (if any) issues in github flooded. So what's the problem? On Thu, Mar 3, 2022, 8:27 PM Max Semenik wrote: > Each of these options would take some time, and time is what > > On Thu, Mar 3, 2022 at 9:14 PM Eugen

Re: [PHP-DEV] PHP Community to support Ukraine and help to stop Russian agression

2022-03-03 Thread Eugene Sidelnyk
Maybe we'd create an RFC, create an poll and decide this way? On Thu, Mar 3, 2022, 8:10 PM Alain D D Williams wrote: > On Thu, Mar 03, 2022 at 07:56:39PM +0200, Eugene Sidelnyk wrote: > > > If you, as PHP community, do not do anything about it, it would mean that > &g

Re: [PHP-DEV] PHP Community to support Ukraine and help to stop Russian agression

2022-03-03 Thread Eugene Sidelnyk
r 3, 2022, 7:59 PM Chase Peeler wrote: > > > On Thu, Mar 3, 2022 at 12:56 PM Eugene Sidelnyk > wrote: > >> All the world currently talks about the situation in Ukraine. Everyone who >> knows the truth are trying to help stop invasion. The main problem here is >>

Re: [PHP-DEV] PHP Community to support Ukraine and help to stop Russian agression

2022-03-03 Thread Eugene Sidelnyk
All the world currently talks about the situation in Ukraine. Everyone who knows the truth are trying to help stop invasion. The main problem here is that most of Russian people believe in Putin's political position. Moreover they will have Instagram and Twitter blocked soon in Russia so that they

Re: [PHP-DEV] Proposal: Adding an ARRAY_FILTER_REINDEX flag to array_values

2021-09-20 Thread Eugene Sidelnyk
Hi, I myself faced such bugs because filter function preserves keys. From my experience it is not that easy to locate bug like this. In my case I rewrote solution in other way than it was originally written. Only later I realized that root cause was array_filter On Sun, Sep 19, 2021, 4:11 PM tyson

Re: [PHP-DEV] Readonly properties - immutability by default

2021-07-17 Thread Eugene Sidelnyk
I don't think the way it is going to be realeased is elegant solution On Sat, Jul 17, 2021, 2:47 PM Andreas Leathley wrote: > On 16.07.21 09:06, Nikita Popov wrote: > > We cannot make properties readonly by default, because that would be a > > major backwards compatibility break. > > > > If you'

Re: [PHP-DEV] Readonly properties - immutability by default

2021-07-16 Thread Eugene Sidelnyk
he will know what he did wrong right in a few seconds. After blowing up (if this will ever happen), programmer will write the code with understanding how and why it works this way. On Fri, Jul 16, 2021 at 7:14 PM Larry Garfield wrote: > On Fri, Jul 16, 2021, at 6:48 AM, Eugene Sidelnyk wrot

Re: [PHP-DEV] Readonly properties - immutability by default

2021-07-16 Thread Eugene Sidelnyk
AM, Bruce Weirdan wrote: > > > > On Fri, Jul 16, 2021 at 9:45 AM Eugene Sidelnyk > wrote: > > > >> Readonly properties are really useful for DDD, where everything is > going to > >> be immutable. It promotes best practices. However for people to use it, >

Re: [PHP-DEV] Readonly properties - immutability by default

2021-07-16 Thread Eugene Sidelnyk
Weirdan wrote: > On Fri, Jul 16, 2021 at 9:45 AM Eugene Sidelnyk > wrote: > > > Readonly properties are really useful for DDD, where everything is going > to > > be immutable. It promotes best practices. However for people to use it, > > syntax should be concise and

Re: [PHP-DEV] Readonly properties - immutability by default

2021-07-16 Thread Eugene Sidelnyk
ill use it because it is too complicated (really, instead of simply declaring an argument, a programmer has to write a bunch of other stuff in front of it for every single method and function). On Fri, Jul 16, 2021 at 10:06 AM Nikita Popov wrote: > On Fri, Jul 16, 2021 at 8:45 AM Eugene Side

[PHP-DEV] Readonly properties - immutability by default

2021-07-15 Thread Eugene Sidelnyk
This is replica of github PR comments: Hi there! Isn't it better to simplify this a bit? I mean `readonly` keyword is really long to type every time we need such property. Earlier (in php7.3) properties were defined only with visibility modifier. Now it is going to become *t verbose*. ```php

Re: [PHP-DEV] Type casting syntax

2021-07-11 Thread Eugene Sidelnyk
IMHO, This is suger which leads to diabetes. It adds pure implicitness without any payback. To convert object into something else add appropriate method. On Sat, Jul 10, 2021, 3:07 PM Marco Pivetta wrote: > Hey Max, > > On Sat, 10 Jul 2021, 11:09 Max Semenik, wrote: > > > I've been thinking abo

[PHP-DEV] Re: Nullsafe Types

2021-06-24 Thread Eugene Sidelnyk
I would really like to hear your thoughts on this. On Thu, Jun 24, 2021, 10:14 PM Eugene Sidelnyk wrote: > Hello, everybody! > > After using nullsafe operator for a while, I have some further thoughts. > In most cases when we make type nullable, we would use nullsafe operator > i

[PHP-DEV] Nullsafe Types

2021-06-24 Thread Eugene Sidelnyk
Hello, everybody! After using nullsafe operator for a while, I have some further thoughts. In most cases when we make type nullable, we would use nullsafe operator if we don't know how to deal with it. This causes clogging main code with this ? signs. Possible solution is to make nullsafe type in

[PHP-DEV] Bug with str_replace

2021-05-25 Thread Eugene Sidelnyk
When use str_replace with arrays there's strange behavior https://3v4l.org/maNqa ```php var_dump(str_replace( [ ',', '.', ],[ '.', ',', ], '1.2,3' )); ``` This code is expecte

Re: [PHP-DEV] Methods Overloading in PHP

2021-02-28 Thread Eugene Sidelnyk
> On 28/02/2021 12:49, Eugene Sidelnyk wrote: > > Hi there! > > I faced a lack of methods overloading in PHP once again and would like to > > ask will it be implemented at some point? > > As well, I want you to show some pros and cons which you see in this > > featu

[PHP-DEV] Methods Overloading in PHP

2021-02-28 Thread Eugene Sidelnyk
Hi there! I faced a lack of methods overloading in PHP once again and would like to ask will it be implemented at some point? As well, I want you to show some pros and cons which you see in this feature. Here're some thoughts about this by Yegor Bugayenko:

Re: [PHP-DEV] Straw poll: Naming for `*any()` and `*all()` on iterables

2020-12-22 Thread Eugene Sidelnyk
Fully agree with Marco On Tue, Dec 22, 2020, 1:00 PM Marco Pivetta wrote: > Hey Tyson, > > I know I'm being stubborn, but we have namespaces, but also an "old guard" > that doesn't understand its own programming language 🤷‍♀️ > > On Sat, Dec 19, 2020, 21:24 tyson andre wrote: > > > Hi internals

Re: [PHP-DEV] Union `&` operator

2020-11-23 Thread Eugene Sidelnyk
or don't. BTW, this way people won't be able to cheat inasmuch vote is an monetary unit On Sat, Nov 14, 2020, 2:56 PM G. P. B. wrote: > On Sat, 14 Nov 2020 at 11:17, Eugene Sidelnyk wrote: > >> Levi will not have time for this. Who else do you suggest? >> > > Pl

Re: [PHP-DEV] Union `&` operator

2020-11-14 Thread Eugene Sidelnyk
Levi will not have time for this. Who else do you suggest? On Sun, Nov 8, 2020, 6:47 PM Eugene Sidelnyk wrote: > > As for when to allow them: as others have suggested in this thread, keep > it simple for now, and only allow intersection of class/interface > references. > >

Re: [PHP-DEV] [RFC] Draft - Closure self reference

2020-11-10 Thread Eugene Sidelnyk
Think the way it is implemented in JS is better than `$lambda` variable. At least it doesn't have BC breaks (does it?) On Tue, Nov 10, 2020, 7:38 PM Hans Henrik Bergan wrote: > something i'm missing from Javascript is the ability to give names to > closures, > this both gives closures the abilit

[PHP-DEV] Alias for `int|float`

2020-11-08 Thread Eugene Sidelnyk
Hello, internals! What do you think about creating shorthand `number` for `int|float`?

Re: [PHP-DEV] Union `&` operator

2020-11-08 Thread Eugene Sidelnyk
, Nov 8, 2020 at 4:53 PM Marco Pivetta wrote: > Hey Eugene, > > On Sat, Nov 7, 2020 at 4:13 PM Eugene Sidelnyk > wrote: > >> ```php >> function foo(A & B & E $object) { >> // some work >> >> var_dump($object); >> } >> ``` >

Re: [PHP-DEV] Union `&` operator

2020-11-08 Thread Eugene Sidelnyk
ould be some case where such features are actually needed. Regards, Eugene On Sat, Nov 7, 2020 at 10:47 PM Sara Golemon wrote: > On Sat, Nov 7, 2020 at 9:33 AM Olle Härstedt > wrote: > >> 2020-11-07 15:12 GMT, Eugene Sidelnyk : >> > function foo(A & B & E $object)

Re: [PHP-DEV] Union `&` operator

2020-11-07 Thread Eugene Sidelnyk
Yes. And I think it will be good if enforced by language. On Sat, Nov 7, 2020, 5:33 PM Olle Härstedt wrote: > 2020-11-07 15:12 GMT, Eugene Sidelnyk : > > When you follow ISP, you probably would have a lot of interfaces. > > Thus, client code may require an object to imple

[PHP-DEV] Union `&` operator

2020-11-07 Thread Eugene Sidelnyk
When you follow ISP, you probably would have a lot of interfaces. Thus, client code may require an object to implement a bunch of interfaces depending on functionality needed. Consider class `Bar`: ```php interface A {} interface B {} interface C {} interface D {} interface E {} class Bar i

Re: [PHP-DEV] Nullsafe

2020-11-04 Thread Eugene Sidelnyk
Yeah... Creating null was a huge mistake. Now it is probably too late to fix that (maybe some new language can introduce that). But what do you think about introducing special class `NullObject`? On Wed, Nov 4, 2020, 9:32 PM Christian Schneider wrote: > Am 04.11.2020 um 19:39 schrieb Eug

Re: [PHP-DEV] Nullsafe

2020-11-04 Thread Eugene Sidelnyk
Thus, can you provide any other dangerous example? On Wed, Nov 4, 2020, 6:59 AM Eugene Sidelnyk wrote: > But wait! > > In your example, funds won't get detracted. If `$accounts->get($receiver)` > will return `null`, then everything inside `addFunds(...)` will not be > e

Re: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
NCTION__); } $foo = null; $foo?->baz(expensive_function()); ``` On Tue, Nov 3, 2020 at 10:11 PM Marco Pivetta wrote: > Heya, > > On Tue, Nov 3, 2020, 17:38 Eugene Sidelnyk wrote: > >> Hello, internals! >> I am wondering why don't we use ordinary `->` operator w

Re: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
""` or `0` or `0.0` or `false` or `[]` - generally speaking `null`. On Tue, Nov 3, 2020 at 9:56 PM Claude Pache wrote: > > > > Le 3 nov. 2020 à 17:38, Eugene Sidelnyk a écrit : > > > > Hello, internals! > > I am wondering why don't we use ordinary `->` op

Re: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
11 PM Marco Pivetta wrote: > Heya, > > On Tue, Nov 3, 2020, 17:38 Eugene Sidelnyk wrote: > >> Hello, internals! >> I am wondering why don't we use ordinary `->` operator with safe null >> handling? Programmers will be more prone to return null values. And t

Re: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
"have bad preconceptions" and would like to find more things they like about the feature. On Tue, Nov 3, 2020 at 8:33 PM G. P. B. wrote: > On Tue, 3 Nov 2020 at 16:48, Benjamin Morel > wrote: > >> On Tue, 3 Nov 2020 at 17:38, Eugene Sidelnyk wrote: >> >

Fwd: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
-- Forwarded message - From: G. P. B. Date: Tue, Nov 3, 2020 at 9:08 PM Subject: Re: [PHP-DEV] Nullsafe To: Eugene Sidelnyk On Tue, 3 Nov 2020 at 19:05, Eugene Sidelnyk wrote: > Null value by itself was invented to indicate lack of data. > But we can't just use it

Fwd: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
h no warning: > https://3v4l.org/Wmun4 > > Benjamin > > On Tue, 3 Nov 2020 at 18:09, Eugene Sidelnyk wrote: > >> But currently working code doesn't fail with NullPointerException? >> Otherwise it would not be a working code. >> Early fail will be when we try return

Fwd: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
-- Forwarded message - From: Eugene Sidelnyk Date: Tue, Nov 3, 2020 at 9:05 PM Subject: Re: [PHP-DEV] Nullsafe To: G. P. B. Null value by itself was invented to indicate lack of data. But we can't just use it instead of objects, because of how it works. We need to cre

Fwd: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
-- Forwarded message - From: Eugene Sidelnyk Date: Tue, Nov 3, 2020 at 8:11 PM Subject: Re: [PHP-DEV] Nullsafe To: Benjamin Morel When trying call a method, php falls with fatal error: https://3v4l.org/jk5Fp With nullsafe it silently returns null: https://3v4l.org/MhXtM Are

Fwd: [PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
-- Forwarded message - From: Eugene Sidelnyk Date: Tue, Nov 3, 2020 at 7:08 PM Subject: Re: [PHP-DEV] Nullsafe To: Benjamin Morel But currently working code doesn't fail with NullPointerException? Otherwise it would not be a working code. Early fail will be when we try r

[PHP-DEV] Nullsafe

2020-11-03 Thread Eugene Sidelnyk
Hello, internals! I am wondering why don't we use ordinary `->` operator with safe null handling? Programmers will be more prone to return null values. And thus, in most of cases `?->` will replace `->`. Why do we need another operator, if we can implement null safe in current operator without BC b