What potential bugs or issues can arise when passing variables in PHP exec() calls on Xampp and Windows 10?

When passing variables in PHP exec() calls on Xampp and Windows 10, potential issues can arise due to the way Windows handles paths and special characters. To solve this problem, it is recommended to use escapeshellarg() function to escape the variables before passing them to the exec() function.

$arg1 = escapeshellarg($variable1);
$arg2 = escapeshellarg($variable2);

exec("command $arg1 $arg2");