is_numeric example

var $hour;
    var $minute;
    var $second;
    var $timezone;

    /** * PHP5 constructor. */
    function __construct( $time )
    {
        // $time can be a PHP timestamp or an ISO one         if (is_numeric($time)) {
            $this->parseTimestamp($time);
        } else {
            $this->parseIso($time);
        }
    }

    /** * PHP4 constructor. */
    public function IXR_Date( $time ) {
        self::__construct( $time );
    }
foreach ($params as $_key => $_value) {
        switch ($_key) {
            case 'loop':
                $$_key = (array)$_value;
                break;

            case 'cols':
                if (is_array($_value) && !empty($_value)) {
                    $cols = $_value;
                    $cols_count = count($_value);
                } elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) {
                    $cols = explode(',', $_value);
                    $cols_count = count($cols);
                } elseif (!empty($_value)) {
                    $cols_count = (int)$_value;
                } else {
                    $cols_count = $cols;
                }
                break;

            case 'rows':
                $$_key = (int)$_value;
                

  public static function createFromTimestamp($timestamp$timezone = NULL, $settings = []) {
    if (!is_numeric($timestamp)) {
      throw new \InvalidArgumentException('The timestamp must be numeric.');
    }
    $datetime = new static('', $timezone$settings);
    $datetime->setTimestamp($timestamp);
    return $datetime;
  }

  /** * Creates a date object from an input format. * * @param string $format * PHP date() type format for parsing the input. This is recommended * to use things like negative years, which php's parser fails on, or * any other specialized input with a known format. If provided the * date will be created using the createFromFormat() method. * @see http://php.net/manual/datetime.createfromformat.php * @param string $time * String representing the time. * @param mixed $timezone * (optional) \DateTimeZone object, time zone string or NULL. See * __construct() for more details. * @param array $settings * (optional) A keyed array for settings, suitable for passing on to * __construct(). Supports an additional key: * - validate_format: (optional) Boolean choice to validate the * created date using the input format. The format used in * createFromFormat() allows slightly different values than format(). * Using an input format that works in both functions makes it * possible to a validation step to confirm that the date created * from a format string exactly matches the input. This option * indicates the format can be used for validation. Defaults to TRUE. * * @return static * A new DateTimePlus object. * * @throws \InvalidArgumentException * If the a date cannot be created from the given format. * @throws \UnexpectedValueException * If the created date does not match the input value. */
try {
                    $key = Inline::parseScalar($values['key']);
                } catch (ParseException $e) {
                    $e->setParsedLine($this->getRealCurrentLineNb() + 1);
                    $e->setSnippet($this->currentLine);

                    throw $e;
                }

                if (!\is_string($key) && !\is_int($key)) {
                    throw new ParseException((is_numeric($key) ? 'Numeric' : 'Non-string').' keys are not supported. Quote your evaluable mapping keys instead.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
                }

                // Convert float keys to strings, to avoid being converted to integers by PHP                 if (\is_float($key)) {
                    $key = (string) $key;
                }

                if ('<<' === $key && (!isset($values['value']) || '&' !== $values['value'][0] || !self::preg_match('#^&(?P<ref>[^ ]+)#u', $values['value']$refMatches))) {
                    $mergeNode = true;
                    $allowOverwrite = true;
                    if (isset($values['value'][0]) && '*' === $values['value'][0]) {
                        
$shopPositionImages = $this->getPositionImages($shopPositionBaseProducts);

        $count = 0;
        foreach ($orders as $orderId => $order) {
            if (empty($customers[$orderId]['email']) || empty($orderPositions[$orderId])) {
                continue;
            }

            $repository = Shopware()->Models()->getRepository(Shop::class);

            $shopId = is_numeric($order['language']) ? $order['language'] : $order['subshopID'];
            $shop = $repository->getActiveById($shopId);
            if ($shop === null) {
                continue;
            }

            $repository = Shopware()->Models()->getRepository(Currency::class);
            $shop->setCurrency($repository->find($order['currencyID']));
            $this->get(ShopRegistrationServiceInterface::class)->registerShop($shop);

            foreach ($orderPositions[$orderId] as &$position) {
                $position['link'] = $this->get(RouterInterface::class)->assemble([
                    
while ( $revision['autosave'] ) {
                $revision = prev( $revisions );
            }
            $current_id = $revision['id'];
        } else {
            $current_id = $revision->ID;
        }
        $revisions[ $current_id ]['current'] = true;
    }

    // Now, grab the initial diff.     $compare_two_mode = is_numeric( $from );
    if ( ! $compare_two_mode ) {
        $found = array_search( $selected_revision_idarray_keys( $revisions ), true );
        if ( $found ) {
            $from = array_keys( array_slice( $revisions$found - 1, 1, true ) );
            $from = reset( $from );
        } else {
            $from = 0;
        }
    }

    $from = absint( $from );

    
use Symfony\Component\Validator\Exception\UnexpectedValueException;

/** * Validates that values are a multiple of the given number. * * @author Colin O'Dell <colinodell@gmail.com> */
class DivisibleByValidator extends AbstractComparisonValidator
{
    protected function compareValues(mixed $value1, mixed $value2): bool
    {
        if (!is_numeric($value1)) {
            throw new UnexpectedValueException($value1, 'numeric');
        }

        if (!is_numeric($value2)) {
            throw new UnexpectedValueException($value2, 'numeric');
        }

        if (!$value2 = abs($value2)) {
            return false;
        }
        if (\is_int($value1 = abs($value1)) && \is_int($value2)) {
            
$host = $request->getHost();
      // To maximize compatibility and normalize the behavior across user       // agents, the cookie domain should start with a dot.       $cookie_domain = '.' . $host;
    }

    // Cookies for domains without an embedded dot will be rejected by user     // agents in order to defeat malicious websites attempting to set cookies     // for top-level domains. Also IP addresses may not be used in the domain     // attribute of a Set-Cookie header. IPv6 addresses will not pass the first     // test, so it's acceptable to bias the second test to IPv4.     if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
      return $cookie_domain;
    }
  }

  /** * Wraps drupal_valid_test_ua(). * * @return string|false * Either the simpletest prefix (the string "simpletest" followed by any * number of digits) or FALSE if the user agent does not contain a valid * HMAC and timestamp. */

                ->end()
                ->children()
                    ->scalarNode('retry_strategy')->defaultNull()->info('service id to override the retry strategy')->end()
                    ->arrayNode('http_codes')
                        ->performNoDeepMerging()
                        ->beforeNormalization()
                            ->ifArray()
                            ->then(static function D$v) {
                                $list = [];
                                foreach ($v as $key => $val) {
                                    if (is_numeric($val)) {
                                        $list[] = ['code' => $val];
                                    } elseif (\is_array($val)) {
                                        if (isset($val['code']) || isset($val['methods'])) {
                                            $list[] = $val;
                                        } else {
                                            $list[] = ['code' => $key, 'methods' => $val];
                                        }
                                    } elseif (true === $val || null === $val) {
                                        $list[] = ['code' => $key];
                                    }
                                }

                                

function get_user_id_from_string( $email_or_login ) {
    _deprecated_function( __FUNCTION__, '3.6.0', 'get_user_by()' );

    if ( is_email( $email_or_login ) )
        $user = get_user_by( 'email', $email_or_login );
    elseif ( is_numeric( $email_or_login ) )
        return $email_or_login;
    else
        $user = get_user_by( 'login', $email_or_login );

    if ( $user )
        return $user->ID;
    return 0;
}

/** * Get a full site URL, given a domain and a path. * * @since MU (3.0.0) * @deprecated 3.7.0 * * @param string $domain * @param string $path * @return string */


namespace Symfony\Component\Cache\Adapter;

/** * @author Lars Strojny <lars@strojny.net> */
final class ParameterNormalizer
{
    public static function normalizeDuration(string $duration): int
    {
        if (is_numeric($duration)) {
            return $duration;
        }

        if (false !== $time = strtotime($duration, 0)) {
            return $time;
        }

        try {
            return \DateTimeImmutable::createFromFormat('U', 0)->add(new \DateInterval($duration))->getTimestamp();
        } catch (\Exception $e) {
            throw new \InvalidArgumentException(sprintf('Cannot parse date interval "%s".', $duration), 0, $e);
        }
$property_definitions = $field->getFieldDefinition()->getFieldStorageDefinition()->getPropertyDefinitions();

    if (!isset($property_definitions['target_id'])) {
      return $resource_identifier;
    }

    $is_data_reference_definition = $property_definitions['target_id'] instanceof DataReferenceTargetDefinition;
    if ($is_data_reference_definition) {
      // Numeric target IDs usually reference content entities, which use an       // auto-incrementing integer ID. Non-numeric target IDs usually reference       // config entities, which use a machine-name as an ID.       $resource_identifier['meta']['drupal_internal__target_id'] = is_numeric($field->target_id)
        ? (int) $field->target_id
        : $field->target_id;
    }
    return $resource_identifier;
  }

  /** * Builds an array of expected related ResourceResponses, keyed by field name. * * @param array $relationship_field_names * The relationship field names for which to build expected * ResourceResponses. * @param array $request_options * Request options to apply. * @param \Drupal\Core\Entity\EntityInterface|null $entity * (optional) The entity for which to get expected related resources. * * @return \Drupal\jsonapi\ResourceResponse[] * An array of expected ResourceResponses, keyed by their relationship field * name. * * @see \GuzzleHttp\ClientInterface::request() */
$version_parts_count = count($version_parts);
    if ($version_parts_count === 2) {
      $minor_version = NULL;
    }
    elseif ($version_parts_count === 3) {
      $minor_version = $version_parts[1];
    }
    $last_part_split = explode('-', $version_parts[count($version_parts) - 1]);
    $version_extra = count($last_part_split) === 1 ? NULL : $last_part_split[1];
    if ($version_parts_count > 3
       || $version_parts_count < 2
       || !is_numeric($major_version)
       || ($version_parts_count === 3 && !is_numeric($version_parts[1]))
       // The only case where a non-numeric version part other the extra part is        // allowed is in development versions like 8.x-1.x-dev, 1.2.x-dev or        // 1.x-dev.        || (!is_numeric($last_part_split[0]) && $last_part_split !== 'x' && $version_extra !== 'dev')) {
      throw new \UnexpectedValueException("Unexpected version number in: $original_version");
    }
    return new static($major_version$minor_version$version_extra);
  }

  /** * Constructs an ExtensionVersion object. * * @param string $major_version * The major version. * @param string|null $minor_version * The minor version. * @param string|null $version_extra * The extra version string. */
$temp = self::_getFile($locale, '/ldml/localeDisplayNames/languages/language', 'type');
                break;

            case 'script':
                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/scripts/script', 'type');
                break;

            case 'territory':
                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/territories/territory', 'type');
                if ($value === 1) {
                    foreach ($temp as $key => $value) {
                        if ((is_numeric($key) === false) and ($key != 'QO') and ($key != 'QU')) {
                            unset($temp[$key]);
                        }
                    }
                } elseif ($value === 2) {
                    foreach ($temp as $key => $value) {
                        if (is_numeric($key) or ($key == 'QO') or ($key == 'QU')) {
                            unset($temp[$key]);
                        }
                    }
                }
                break;

            
/** * Returns the upload quota for the current blog. * * @since MU (3.0.0) * * @return int Quota in megabytes. */
function get_space_allowed() {
    $space_allowed = get_option( 'blog_upload_space' );

    if ( ! is_numeric( $space_allowed ) ) {
        $space_allowed = get_site_option( 'blog_upload_space' );
    }

    if ( ! is_numeric( $space_allowed ) ) {
        $space_allowed = 100;
    }

    /** * Filters the upload quota for the current site. * * @since 3.7.0 * * @param int $space_allowed Upload quota in megabytes for the current blog. */
Home | Imprint | This part of the site doesn't use cookies.