semi-dirty PHP trick?
Aug. 21st, 2006 12:20 amHow ugly is this approach to making a copy of an array that moves only values, not references?
I feel a little dirty... assuming I'm not too worried about efficiency, should I?
$copy_of_array = unserialize(serialize($multidimensional_array));I feel a little dirty... assuming I'm not too worried about efficiency, should I?
Re: efficiency
Date: 2006-09-18 01:49 am (UTC)I eventually found out that PHP 4 has easy cloning behaviour, but PHP 5 acts like ECMAScript, with its "composite types are always piles of references" thing. Ick. Maybe I should learn more C and write webpages in it or something.