Function __global->empty

Definitions

sources_custom/phpstub.php

  • Determine whether a variable is empty (empty being defined differently for different types).Note that the string '0' is considered empty. If you don't want that, use cms_empty_safe (maybe with @), or a combination of isset and is_numeric.Generally this function is used if you don't want to check for array index presence, non-nullness, non-blank-stringness, and non-zeroness via individual ANDd clauses.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$var mixed No No required parameter N/A N/A Input

Returns

  • Whether it is CONSIDERED empty
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Determine whether a variable is empty (empty being defined differently for different types).Note that the string '0' is considered empty. If you don't want that, use cms_empty_safe (maybe with @), or a combination of isset and is_numeric.Generally this function is used if you don't want to check for array index presence, non-nullness, non-blank-stringness, and non-zeroness via individual ANDd clauses.
 *
 * @param  mixed $var Input
 * @return boolean Whether it is CONSIDERED empty
 */

function empty($var) : bool