Why is this happening with my variables?
<pre><code>&lt;?php

// $searchResult is type of Outcome
// This is what we do:
dList::lessAnchor($searchResult)-&gt;showElement();
dList::moreAnchor($searchResult)-&gt;showElement();

/**
* @returns vAnchor (can get showed with showElement() - not part of the problem)
*/
public static function lessAnchor(Outcome $searchResult){
  $searchData = $searchResult-&gt;searchData;
  $searchData-&gt;Page = $searchData-&gt;Page - 1; // (!1)
  return self::basicAnchor($searchData, "Back");
}

/**
* @returns vAnchor (can get showed with showElement() - not part of the problem)
*/
public static function moreAnchor(Outcome $searchResult){
  $searchData=$searchResult-&gt;searchData;
  $searchData-&gt;Page = $searchData-&gt;Page + 1; // (!2)
  return self::basicAnchor($searchData, "More");
}
</code></pre>

<p>When I call <code>dList::lessAnchor()</code> on <code>$searchResult</code>, it modifies the property of <code>$searchData-&gt;Page</code> by decreasing it by 1 as you see, marked at line with <code>(!1)</code>.
After a while (one line below), I call <code>dList::moreAnchor()</code> on <code>$searchResult</code> again.</p>

<p>Why do I see <code>Page</code> attribute decreased by 1 at <code>(!2)</code> mark? I did not pass <code>$searchResult</code> by reference.</p>
