original_string: public function get_option_name_from_constant($constant) {
          if (is_null(self::$constants)) {
              $constants = get_defined_constants(true);
              $constants = isset($constants['curl']) ? $constants['curl'] : array();
              $constants = array_flip($constants);
              self::$constants = $constants;
          }
          if (isset(self::$constants[$constant])) {
              return self::$constants[$constant];
          }
          throw new coding_exception('Unknown curl constant value: ' . $constant);
      }
code: public function get_option_name_from_constant($constant) {
          if (is_null(self::$constants)) {
              $constants = get_defined_constants(true);
              $constants = isset($constants['curl']) ? $constants['curl'] : array();
              $constants = array_flip($constants);
              self::$constants = $constants;
          }
          if (isset(self::$constants[$constant])) {
              return self::$constants[$constant];
          }
          throw new coding_exception('Unknown curl constant value: ' . $constant);
      }
code_tokens: public function get_option_name_from_constant ( $ constant ) { if ( is_null ( self :: $ constants ) ) { $ constants = get_defined_constants ( true ) ; $ constants = isset ( $ constants [ 'curl' ] ) ? $ constants [ 'curl' ] : array ( ) ; $ constants = array_flip ( $ constants ) ; self :: $ constants = $ constants ; } if ( isset ( self :: $ constants [ $ constant ] ) ) { return self :: $ constants [ $ constant ] ; } throw new coding_exception ( 'Unknown curl constant value: ' . $ constant ) ; }
docstring: Return the name of an option based on the constant value.
  
  @param int $constant value of a CURL constant.
  @return string name of the constant if found, or throws exception.
  @throws coding_exception when the constant is not found.
  @since Moodle 2.5
docstring_tokens: Return the name of an option based on the constant value .