phalcon registry not working

I got Phalcon 2.0.3 on debian . Php 5.6.11
Phalcon registry is not working;
$this->registry->something['foo']=2; I get this
Indirect modification of overloaded property Phalcon\Registry::$something if registry->something exists there is no way to change a part of a property. Any Idea Thx in advance

You have to use two seperate steps:

$data['foo'] = 2;
$this->registry->something = $data;


Hi Thanks for the answer. This would mean if I want to change/add a value in an array in the registry I neeed these steps:

  1. get a copy of the registry array
  2. change/add value in the array 3 override the old registry value Is the registry meant to function in this way? what about performance advantage? I am just wondering :) I think i should better skip this registry thing :) Thx in advance