Put a space between the (type) and the $variable in a cast: (int) $mynumber.