I have the following code:
$data[\'x\'] = $this->x->getResults(); $data[\'y\'] = $data[\'x\']; //some code here to modify $data[\'y\'] //this cause
I just discovered that if you simply want a copy of an array of values (no references) from a constant then you can just write:
$new_array = (array) (object) self::old_array;
Not an exact answer to the OP's question but it helped me and might help someone else.