diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-11-22 15:06:04 +0100 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-11-22 15:06:04 +0100 |
commit | a386cb3d71e5ee4daf845a0fcfa615290bd31299 (patch) | |
tree | 81ca5767e5e34459047f4015acee4f815e8070b7 /Model | |
parent | 942f1864e7b51d465c9970ae6ce8b9a6c8927fb5 (diff) | |
download | Praspel-a386cb3d71e5ee4daf845a0fcfa615290bd31299.zip Praspel-a386cb3d71e5ee4daf845a0fcfa615290bd31299.tar.gz Praspel-a386cb3d71e5ee4daf845a0fcfa615290bd31299.tar.bz2 |
Remove reference when setting the value.
If the variable is an argument that is passed by-reference, and, if its
value is changed during the execution of the system, its reference will
be propagated until here. Consequently, in the post-state of the system,
the value of the variable in the pre-state will be equal to the value in
the post-state. This is an error. Thus, we copy the value instead of
using a reference (initially introduced for performance reason).
Diffstat (limited to 'Model')
-rw-r--r-- | Model/Variable/Variable.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Model/Variable/Variable.php b/Model/Variable/Variable.php index 8501d32..6a429b3 100644 --- a/Model/Variable/Variable.php +++ b/Model/Variable/Variable.php @@ -178,13 +178,13 @@ class Variable * Set a value to the variable. * * @access public - * @param mixed &$value Value. + * @param mixed $value Value. * @return mixed */ - public function setValue ( &$value ) { + public function setValue ( $value ) { $old = $this->_value; - $this->_value = &$value; + $this->_value = $value; return $old; } |