In sfRoutingConfigHandler.class.php the return value of serialze is written to a PHP file in the cache as if it is valid PHP.
When the routing.yml contains a double backslash (e.g. in a requirements regex), the double backslash remains inside the serialized string. This double backslash therefore is written in between the single quoted string to config_routing.yml.php. When interpreted back as PHP, this double backslash is read as an escaped backslash, and results in errors like
Warning: Insufficient data for unserializing - 1927 required, 1926 present in C:\ ... \cache\gp\dev\config\config_routing.yml.php on line 32.
The serialization output needs to be escaped properly.