generateUrl problem <p>I am trying to generate a url but I keep getting a strange warning even though it works. I am making an api xml page and I use the following call in the controller:</p> <pre><code>public function executeList(sfWebRequest $request) { $this-&gt;users = array(); foreach($this-&gt;getRoute()-&gt;getObjects() as $user) { $this-&gt;users[$this-&gt;generateUrl('user_show', $user, true)] = $user-&gt;asArray($request-&gt;getHost()); } } </code></pre> <p>The user_show route is as follows:</p> <pre><code># api urls user_show: url: /user/:nickname param: { module: user, action: show } </code></pre> <p>And the xml outputs as follows:</p> <pre><code>&lt;br /&gt; &lt;b&gt;Warning&lt;/b&gt;: array_diff_key() [&lt;a href='function.array-diff-key'&gt;function.array-diff-key&lt;/a&gt;]: Argument #1 is not an array in &lt;b&gt;/opt/local/lib/php/symfony/routing/sfRoute.class.php&lt;/b&gt; on line &lt;b&gt;253&lt;/b&gt;&lt;br /&gt; &lt;br /&gt; &lt;b&gt;Warning&lt;/b&gt;: array_diff_key() [&lt;a href='function.array-diff-key'&gt;function.array-diff-key&lt;/a&gt;]: Argument #1 is not an array in &lt;b&gt;/opt/local/lib/php/symfony/routing/sfRoute.class.php&lt;/b&gt; on line &lt;b&gt;253&lt;/b&gt;&lt;br /&gt; &lt;br /&gt; &lt;b&gt;Warning&lt;/b&gt;: array_diff_key() [&lt;a href='function.array-diff-key'&gt;function.array-diff-key&lt;/a&gt;]: Argument #1 is not an array in &lt;b&gt;/opt/local/lib/php/symfony/routing/sfRoute.class.php&lt;/b&gt; on line &lt;b&gt;253&lt;/b&gt;&lt;br /&gt; &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;users&gt; &lt;user url="http://krowdd.dev/frontend_dev.php/user/danny"&gt; &lt;name&gt;Danny tz&lt;/name&gt; &lt;nickname&gt;danny&lt;/nickname&gt; &lt;email&gt;comedy9@gmail.com&lt;/email&gt; &lt;image&gt;&lt;/image&gt; &lt;/user&gt; &lt;user url="http://krowdd.dev/frontend_dev.php/user/adrian"&gt; &lt;name&gt;Adrian Sooian&lt;/name&gt; &lt;nickname&gt;adrian&lt;/nickname&gt; &lt;/user&gt; &lt;/users&gt; </code></pre> <p>So it outputs the correct xml but I do not know why it throws thows warning when calling the generateurl method.</p> <p>Thanks!</p>