3v4l.org

run code in 500+ PHP versions simultaneously
<?php use BcMath\Number; $a = new Number('1.005691112'); $b = new Number('2.567891112'); $result = $a ** $b; echo $result->round(2); echo PHP_EOL; echo $result; echo PHP_EOL; echo 1.005691112 ** 2.567891112; echo PHP_EOL; echo 'precision is '.ini_get('precision');
Output for 8.2.31, 8.3.0 - 8.3.31, 8.5.0 - 8.5.7
Fatal error: Uncaught Error: Class "BcMath\Number" not found in /in/9i85S:5 Stack trace: #0 {main} thrown in /in/9i85S on line 5
Process exited with code 255.
Output for 8.4.1 - 8.4.21
Fatal error: Uncaught ValueError: exponent cannot have a fractional part in /in/9i85S:8 Stack trace: #0 {main} thrown in /in/9i85S on line 8
Process exited with code 255.

preferences:
52.24 ms | 745 KiB | 4 Q