PHP automatics type conversion
Automatic type conversion is essential when two differently typed variables are combined in an expression or when a variable is passed as an argument to a library function that expects a different type. In PHP when a variable of one type is used as another data type, it is automatically converted to a value of the required data type.Example:
// $var is set as an integer = 115
$var = "100" + 15;
// $var is set as a float = 115.0
$var = "100" + 15.0;
PHP does not support explicit type definition in variable declaration; a variable's type is determined by the context in which the variable is used. For e.g. if $var is assigned a string value, the type of $var becomes string.