diff --git a/lib/bcmath.php b/lib/bcmath.php index 75aa46a..3b039a2 100644 --- a/lib/bcmath.php +++ b/lib/bcmath.php @@ -169,17 +169,20 @@ class TypeError extends Error { } } +$autoLoad = version_compare(PHP_VERSION, '7.1.0', '>='); // the following was introduced in PHP 7.1.0 -if (!class_exists('ArgumentCountError')) { +if (!class_exists('ArgumentCountError', $autoload)) { class ArgumentCountError extends TypeError { } } +$autoLoad = version_compare(PHP_VERSION, '8.0.0', '>='); + // the following was introduced in PHP 8.0.0 -if (!class_exists('ValueError')) { +if (!class_exists('ValueError', $autoload)) { class ValueError extends Error { } -} \ No newline at end of file +}