Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

(no description)

File Size: 173 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Set:: (17 methods):
  __construct()
  union()
  intersection()
  difference()
  cartesian()
  power()
  add()
  addAll()
  remove()
  removeAll()
  contains()
  containsAll()
  toArray()
  getIterator()
  isEmpty()
  cardinality()
  sanitize()


Class: Set  - X-Ref

__construct(array $elements = [])   X-Ref

param: string[]|int[]|float[]|bool[] $elements

union(self $a, self $b)   X-Ref
Creates the union of A and B.


intersection(self $a, self $b)   X-Ref
Creates the intersection of A and B.


difference(self $a, self $b)   X-Ref
Creates the difference of A and B.


cartesian(self $a, self $b)   X-Ref
Creates the Cartesian product of A and B.

return: Set[]

power(self $a)   X-Ref
Creates the power set of A.

return: Set[]

add($element)   X-Ref

param: string|int|float|bool $element

addAll(array $elements)   X-Ref

param: string[]|int[]|float[]|bool[] $elements

remove($element)   X-Ref

param: string|int|float $element

removeAll(array $elements)   X-Ref

param: string[]|int[]|float[] $elements

contains($element)   X-Ref

param: string|int|float $element

containsAll(array $elements)   X-Ref

param: string[]|int[]|float[] $elements

toArray()   X-Ref

return: string[]|int[]|float[]|bool[]

getIterator()   X-Ref
No description

isEmpty()   X-Ref
No description

cardinality()   X-Ref
No description

sanitize(array $elements)   X-Ref
Removes duplicates and rewrites index.

param: string[]|int[]|float[]|bool[] $elements
return: string[]|int[]|float[]|bool[]