On Mon, Jul 7, 2025 at 7:25 PM Joseph Leedy <joseph+...@josephleedy.dev>
wrote:

>
> As a developer, I would like to have variables of one type cast to another
> type automatically so that I do not need to assign the variable to itself.
>
>
> What if we could do this instead?
>
> ```php
> $price = '5.0123';
> ...
> (float) $price;
>
> var_dump($price); // Result: `float: 5.0123`
> ```
>
>
This is valid code now, and does not perform the cast.
You need to use a slightly different syntax, maybe `(float)&$price;` that
is an error now.

-- 
Alex

Reply via email to