symfony/symfony — pull request #4755 by Crell (2012-07-04 20:45:44+00:00)
Title: When serializing a Route, don't serialize the compiled route.

The compiled route typically has a reference to the Route. The Route of course has a reference to the compiled route. This is a circular reference. That can sometimes cause issues, say for var_export(). I ran into this issue while serializing route objects, but it could happen in other cases, too.

In any event, since the compiled route object is simply derived data I see no reason to keep it around. If we serialize a Route, we just want the basic route information. We can recompile later if needs be. As a nice side-effect, this makes the serialized string much smaller.