Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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[]