Skip to content

Commit 8ab25e8

Browse files
authored
Update benchmark.php
Stripped out the pi maths function. It doesn't really do any maths, just returns a constant float M_PI which doesn't really benchmark PHP mathematical performance. (See: /ext/standard/php_math.h:#define M_PI 3.14159265358979323846 /* pi */) Also as of PHP 8.0 it will throw a PHP Fatal error if you pass an argument to the pi function: PHP Fatal error: Uncaught ArgumentCountError: pi() expects exactly 0 arguments, 1 given in /var/www/html/benchmark.php:182
1 parent 9cfb46b commit 8ab25e8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

benchmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function test_math(&$result, $count = 99999)
176176
{
177177
$timeStart = microtime(true);
178178

179-
$mathFunctions = array("abs", "acos", "asin", "atan", "bindec", "floor", "exp", "sin", "tan", "pi", "is_finite", "is_nan", "sqrt");
179+
$mathFunctions = array("abs", "acos", "asin", "atan", "bindec", "floor", "exp", "sin", "tan", "is_finite", "is_nan", "sqrt");
180180
for ($i = 0; $i < $count; $i++) {
181181
foreach ($mathFunctions as $function) {
182182
call_user_func_array($function, array($i));

0 commit comments

Comments
 (0)