hhvm / user-documentation

Documentation for those that use HHVM and write Hack code.

Home Page:http://docs.hhvm.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hack Array Immutable Documentation

MujingZhou opened this issue · comments

Please complete the information below:

Where is the problem?

What is the problem?

  • It is confusing/wrong in this piece of the example code ("C\contains($items, 'a'); // true"). After modifying in above lines, it should be false
  • When explaining the immutable characteristic, I suppose it means the modification does not occur at the same memory location referenced Hack array, but instead create a modifiable copy. Perhaps it can use an example so it first assign the array to another variable ($items2 = $items) and then modify the $items, and check the values for both $items and $items2

Please don't change anything below this point.


  • Build ID: HHVM=HHVM-4.164.0:HSL=v4.108.1:2023-11-08T01:59:56+0000:1fa47f258c6b68f8ec01899aa82fd6ffa0957109
  • Page requested: /hack/arrays-and-collections/vec-keyset-and-dict
  • Page requested at: Thu, 09 Nov 2023 00:23:18 +0000
  • Controller: GuidePageController