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.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

   1  <?php
   2  
   3  /**
   4   * SCSSPHP
   5   *
   6   * @copyright 2015-2020 Leaf Corcoran
   7   *
   8   * @license http://opensource.org/licenses/MIT MIT
   9   *
  10   * @link http://scssphp.github.io/scssphp
  11   */
  12  
  13  namespace ScssPhp\ScssPhp\Base;
  14  
  15  /**
  16   * Range
  17   *
  18   * @author Anthon Pang <anthon.pang@gmail.com>
  19   */
  20  class Range
  21  {
  22      public $first;
  23      public $last;
  24  
  25      /**
  26       * Initialize range
  27       *
  28       * @param integer|float $first
  29       * @param integer|float $last
  30       */
  31      public function __construct($first, $last)
  32      {
  33          $this->first = $first;
  34          $this->last = $last;
  35      }
  36  
  37      /**
  38       * Test for inclusion in range
  39       *
  40       * @param integer|float $value
  41       *
  42       * @return boolean
  43       */
  44      public function includes($value)
  45      {
  46          return $value >= $this->first && $value <= $this->last;
  47      }
  48  }