/** * Creates a new scope, setting the old one as its parent */ public function new_scope() { $this->scopes[] = $scope = new Scope(); $scope->setParent($this->scope); return $this->scope = $scope; }