Function __global->cms_empty_safe

Definitions

sources/global2.php

  • Determine whether a variable is empty (empty being defined differently for different types).The string '0' is NOT considered empty, unlike the default PHP empty language construct.Generally this function is used if you don't want to check for array index presence, non-nullness, and non-blank-stringness via individual ANDd clauses.As this is a function and not a language construct, reference to non-set variables or array indices need guarding using @.
  • 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).The string '0' is NOT considered empty, unlike the default PHP empty language construct.Generally this function is used if you don't want to check for array index presence, non-nullness, and non-blank-stringness via individual ANDd clauses.As this is a function and not a language construct, reference to non-set variables or array indices need guarding using @.
 *
 * @param  mixed $var Input
 * @return boolean Whether it is CONSIDERED empty
 */

function cms_empty_safe($var) : bool
 

sources/minikernel.php

  • Determine whether a variable is empty (empty being defined differently for different types).The string '0' is NOT considered empty, unlike the default PHP empty language construct.As this is a function and not a language construct, reference to non-set variables or array indices need guarding using @.
  • 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).The string '0' is NOT considered empty, unlike the default PHP empty language construct.As this is a function and not a language construct, reference to non-set variables or array indices need guarding using @.
 *
 * @param  mixed $var Input
 * @return boolean Whether it is CONSIDERED empty
 */

function cms_empty_safe($var) : bool