Logo

Variable handling Functions

boolval debug_zval_dump doubleval floatval get_debug_type get_defined_vars get_resource_id get_resource_type gettype intval is_array is_bool is_callable is_countable is_double is_float is_int is_integer is_iterable is_long is_null is_numeric is_object is_resource is_scalar is_string print_r serialize settype strval unserialize var_dump var_export

is_numeric

Logo PHPCompatibility/PHPCompatibility PHPCompatibility/PHPCompatibility
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds whether a variable is a number or a numeric string
<?php is_numeric(mixed $value): bool
<?php                 $level = null;

                if ($codeString !== '') {

                    if (\is_numeric($codeString)) {

                        $level = (int) $codeString;

                    } else {
PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php
<?php     protected function isNumeric($value)

    {

        return \is_numeric($value);

    }
PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php