What are the common mistakes made when shifting hexadecimal values in PHP calculations and how can they be avoided?

When shifting hexadecimal values in PHP calculations, a common mistake is forgetting to convert the hexadecimal value to an integer before performing bitwise operations. To avoid this issue, always use the `hexdec()` function to convert the hexadecimal value to an integer before shifting it.

// Incorrect way - shifting hexadecimal value without converting to integer
$hexValue = '0x10';
$shiftedValue = $hexValue << 1; // Incorrect

// Correct way - converting hexadecimal value to integer before shifting
$hexValue = '0x10';
$intValue = hexdec($hexValue);
$shiftedValue = $intValue << 1; // Correct