On Fri, Mar 31, 2023 at 3:24 PM Larry Garfield <la...@garfieldtech.com> wrote:
>> In other words, will it be possible for this to no longer be true (I'm
>> not sure it is always true now, fwiw):
>>
>> $x = $y = $z = 1;
>>
>> $x === $y && $y === $z;
> That would mean the following as a side effect:
>
> $f = new Foo();
> $val = '5';
> $f->val = $val;
> $f->val === $val; // false, because different types!

Ah, I see now what you meant, Robert. This already doesn't hold.

class Foo {
    public int $prop;
}
$foo = new Foo();
$value = '42';
$foo->prop = $value;
var_dump($value === $foo->prop);
// false

Ilija

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

Reply via email to