static function evalConstant ($exp, &$valid = null)
  {
    $exp = trim ($exp);
    if ($exp !== '') {
      $valid = true;
      if ($exp[0] == '"' || $exp[0] == "'") return substr ($exp, 1, -1);
      if (is_numeric ($exp)) {
        return ctype_digit ($exp) ? intval ($exp) : floatVal ($exp);
      }
      if (defined ($exp))
        return constant ($exp);
    }
    $valid = false;
    return null;
  }
static function evalConstant ($exp, &$valid = null)
  {
    $exp = trim ($exp);
    if ($exp !== '') {
      $valid = true;
      if ($exp[0] == '"' || $exp[0] == "'") return substr ($exp, 1, -1);
      if (is_numeric ($exp)) {
        return ctype_digit ($exp) ? intval ($exp) : floatVal ($exp);
      }
      if (defined ($exp))
        return constant ($exp);
    }
    $valid = false;
    return null;
  }
static function evalConstant ( $ exp , & $ valid = null ) { $ exp = trim ( $ exp ) ; if ( $ exp !== '' ) { $ valid = true ; if ( $ exp [ 0 ] == '"' || $ exp [ 0 ] == "'" ) return substr ( $ exp , 1 , - 1 ) ; if ( is_numeric ( $ exp ) ) { return ctype_digit ( $ exp ) ? intval ( $ exp ) : floatVal ( $ exp ) ; } if ( defined ( $ exp ) ) return constant ( $ exp ) ; } $ valid = false ; return null ; }
Tries to evaluate a constant value expressed as a string.

@param string $exp
@param bool   $valid [optional] Outputs `true` if the expression was successfully evaluated.
@return mixed
Tries to evaluate a constant value expressed as a string .