There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

derpgon , (edited )

Arrays are passed by copy by default. Every scalar or array value is copied by value. Every other thing (objects basically) is copied by reference.

Passing array by reference passes everything it used to copy by reference.

Attempting to clone an array will result in an error.

Reassignment of a variable containing an array will do the same as if passed to a function by value.

Reassignment of a variable containing an array using the reference operator will do the same as if passed to a function by reference.

So, in order to deep copy an array, just reassign and recursively traverse the array calling clone on each object. Of course, this would break (or not, depending on the intended use) when the same object is referenced multiple times under different keys.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines