Function __global->either_param_integer

Definitions

sources/global2.php

  • This function is the integeric partner of either_param_string, as it returns the value as an integer.You should always use integer specified versions when inputting integers, for the added security that type validation allows. If the value is of the wrong type, it indicates a hack attempt and will be logged.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name ID_TEXT No No required parameter N/A N/A The name of the parameter to get
$default ?~mixed No No False N/A N/A The default value to give the parameter if the parameter value is not defined or the empty string (null: allow missing parameter) (false: give error on missing parameter)

Returns

  • The parameter value (null: not set, and null given as default)
  • Type: ?integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * This function is the integeric partner of either_param_string, as it returns the value as an integer.You should always use integer specified versions when inputting integers, for the added security that type validation allows. If the value is of the wrong type, it indicates a hack attempt and will be logged.
 *
 * @param  ID_TEXT $name The name of the parameter to get
 * @param  ?~mixed $default The default value to give the parameter if the parameter value is not defined or the empty string (null: allow missing parameter) (false: give error on missing parameter)
 * @return ?integer The parameter value (null: not set, and null given as default)
 */

function either_param_integer(string $name, $default = false) : ?int
 

sources/minikernel.php

  • This function is the integeric partner of either_param_string, as it returns the value as an integer.You should always use integer specified versions when inputting integers, for the added security that type validation allows. If the value is of the wrong type, it indicates a hack attempt and will be logged.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name ID_TEXT No No required parameter N/A N/A The name of the parameter to get
$default ?~mixed No No False N/A N/A The default value to use for the parameter (null: no default) (false: give error on missing parameter)

Returns

  • The parameter value (null: not found and default was null)
  • Type: ?integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * This function is the integeric partner of either_param_string, as it returns the value as an integer.You should always use integer specified versions when inputting integers, for the added security that type validation allows. If the value is of the wrong type, it indicates a hack attempt and will be logged.
 *
 * @param  ID_TEXT $name The name of the parameter to get
 * @param  ?~mixed $default The default value to use for the parameter (null: no default) (false: give error on missing parameter)
 * @return ?integer The parameter value (null: not found and default was null)
 */

function either_param_integer(string $name, $default = false) : ?int