I wonder how I can rename an object property in PHP, for example:
<?php
$obj = new stdclass();
$obj->a = 10;
$obj->b = $obj->a;
unset($obj->a);
This does not work in PHP5.3, (donno about earlier versions), since there will be a link $obj->aassigned to $obj->b, and therefore, by turning it off $obj->a, the value $obj->bwill be zero, Any ideas, please?
user80276
source
share