In PHP you can typecast something as an object like this; (object) or you can use settype($var, \"object\") - but my question is what is the difference between the two?
Casting changes what the variable is being treated as in the current context, settype changes it permanently.
$value = "100"; //Value is a string
echo 5 + (int)$value; //Value is treated like an integer for this line
settype($value,'int'); //Value is now an integer
Basically settype is a shortcut for:
$value = (type)$value;