Skip to content

Commit

Permalink
fixed code when dealing with circular references
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jul 12, 2014
1 parent 6a18683 commit 52f5d09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Pimple/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ public function offsetGet($id)
return $this->values[$id]($this);
}

$raw = $this->values[$id];
$val = $this->values[$id] = $raw($this);
$this->raw[$id] = $raw;

$this->frozen[$id] = true;
$this->raw[$id] = $this->values[$id];

return $this->values[$id] = $this->values[$id]($this);
return $val;
}

/**
Expand Down

0 comments on commit 52f5d09

Please sign in to comment.