I could be wrong about the inefficiency, maybe arrays in PHP are implemented as "copy on write". But seeing how PHP is such a mess of a language, I somehow doubt it...
They ARE implemented as COW. It's discouraged to use explicit reference passing if you don't want to alter the array as PHP has to do a slight bit more work if you pass a reference.
I think copy on write was added in the 5.1 timeframe (around 2005)
Thanks for the info. I do think the default should have been pass by reference though, like with objects since PHP5.
Arrays (and everything else) should be objects. That would also solve the pass-by-reference issue and would clean up the global namespace that's littered with array_* functions.