1.2.119. Cast Usage¶
List of all cast usage.
PHP does not require (or support) explicit type definition in variable declaration; a variable’s type is determined by the context in which the variable is used.
Until PHP 7.2, a (unset)
operator was available. It had the same role as unset()
as a function.
<?php
if (is_int($_GET['x'])) {
$number = (int) $_GET['x'];
} else {
error_display('a wrong value was provided for "x"');
}
?>
See also Type Juggling and unset.
1.2.119.1. Connex PHP features¶
1.2.119.1.1. Specs¶
Short name |
Php/CastingUsage |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |