On Tue, 11 Feb 2025, 17:07 Valentin Udaltsov,
wrote:
>
> > Static analysis already complain about it
>
> That's exactly where `!` is helpful. If at a certain point I am sure that
> a property must not be null and I want to make that explicit (to both
> developer and static analyzer), I can use
>
On Tue, Feb 11, 2025, at 17:06, Valentin Udaltsov wrote:
> On Friday, 7 Feb 2025 at 10:45, Faizan Akram Dar wrote:
>>
>>
>> On Fri, 7 Feb 2025, 08:30 Mihail Liahimov, <91lia...@gmail.com> wrote:
>>> Thank you for your answer. Now I will give examples for better
>>> understanding.
>>>
>>> Simpl
On Friday, 7 Feb 2025 at 10:45, Faizan Akram Dar
wrote:
>
>
> On Fri, 7 Feb 2025, 08:30 Mihail Liahimov, <91lia...@gmail.com> wrote:
>
>> Thank you for your answer. Now I will give examples for better
>> understanding.
>>
>> Simple examples from Typescript:
>>
>> let foo = ...
>> foo!.bar()
>> fo
HI!
I was referring to this particular scenario of using this operator.
Constantly writing checks and nullsafes seems like something superfluous.
If we have an opportunity at the language level to throw a domain exception
or something like that, it will be convenient. Besides, it will also be
usef
> Hello,
>
> I feel like that is more of an architecture problem than a programming one
> though. Instead of constantly checking if the conditions are right, use php's
> type system instead, so it would read more like:
>
> if ($response instanceof SuccessfulResponse) {
> return $response->data-
On Fri, Feb 7, 2025, at 10:21, MrMeshok wrote:
> >
> > Examples of potentially using in PHP:
> > Without this operator we writing this code:
> >
> > $foo = ...
> >
> > if ($foo === null) {
> > throw new FooIsNullException();
> > }
> >
> > $foo->bar.
> >
> > With this operator:
> >
> > $foo!->ba
>
> Examples of potentially using in PHP:
> Without this operator we writing this code:
>
> $foo = ...
>
> if ($foo === null) {
> throw new FooIsNullException();
> }
>
> $foo->bar.
>
> With this operator:
>
> $foo!->bar
> $foo!->someProperty->method();
> $foo!->someProperty->anotherProperty!->m
On Fri, 7 Feb 2025, 08:30 Mihail Liahimov, <91lia...@gmail.com> wrote:
> Thank you for your answer. Now I will give examples for better
> understanding.
>
> Simple examples from Typescript:
>
> let foo = ...
> foo!.bar()
> foo!.someProperty.baz()
>
> Examples of potentially using in PHP:
> Without
On Thu, Feb 6, 2025, at 6:50 AM, Mihail Liahimov wrote:
> Thank you for your answer. Now I will give examples for better
> understanding.
>
> Simple examples from Typescript:
>
> let foo = ...
> foo!.bar()
> foo!.someProperty.baz()
>
> Examples of potentially using in PHP:
> Without this operator w
On 06.02.2025 at 15:48, Ilija Tovilo wrote:
> * Is assert($foo !== null); $foo->bar; really much worse? I understand
> it requires two statements, so it cannot be used in all contexts.
In my opinion, it is better, because you can completely disable the
assertion checking in production.
> * Are w
Hi Mihail
On Thu, Feb 6, 2025 at 1:51 PM Mihail Liahimov <91lia...@gmail.com> wrote:
>
> Examples of potentially using in PHP:
> Without this operator we writing this code:
>
> $foo!->bar
> $foo!->someProperty->method();
> $foo!->someProperty->anotherProperty!->method();
>
> I think the postfix op
Thank you for your answer. Now I will give examples for better
understanding.
Simple examples from Typescript:
let foo = ...
foo!.bar()
foo!.someProperty.baz()
Examples of potentially using in PHP:
Without this operator we writing this code:
$foo = ...
if ($foo === null) {
throw new FooIsNullE
Hi Mihail
Thanks for your proposal.
On Wed, Feb 5, 2025 at 9:24 AM Mihail Liahimov <91lia...@gmail.com> wrote:
>
> Good afternoon. I would like to create an RFC on the implementation of the
> NOT null assertion operator. Do you think it makes sense to create it? I was
> able to implement the op
13 matches
Mail list logo