The (real) cast is deprecated, use (float) instead¶
Description¶
The (real)
cast operator is deprecated in PHP 7.4. It will be completely removed in PHP 8.0.
Example¶
<?php
$float = (real) 1.333;
?>
Solutions¶
Use
(float)
instead.
In more recent PHP versions, this error message is now The (real) cast operator has been removed, use (float) instead. Both operator looked like synonyms, and were providing the same feature..