Warning: Division by zero in /var/customers/webs/stc/benchmark/index.php on line 256 Test: is_float vs. Float Casting

PHP Benchmarks

Performance comparison of PHP code alternatives.

Test: is_float vs. Float Casting

Cast vs is_float

Run Again Test Menu

Result

Unfortunately, no history for this test is available.

Code

The first test, "is_float", was:

$a = is_float($GLOBALS['test']);

The second test, "Casting", was:

$a = (float) $GLOBALS['test'] === $GLOBALS['test'];

Running: Linux (x86_64:1 GB) PHP (7.2.25-1+ubuntu16.04.1+deb.sury.org+1)