mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Added BcMath\Number class. It is an immutable object, has methods that are equivalent to existing BCMath calculation functions, and can also be calculated using operators. The existing BCMath function returned a string for each calculation, but this class returns an object. RFC: https://wiki.php.net/rfc/support_object_type_in_bcmath, https://wiki.php.net/rfc/fix_up_bcmath_number_class --------- Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
14 lines
228 B
PHP
14 lines
228 B
PHP
--TEST--
|
|
BcMath\Number class extends error
|
|
--EXTENSIONS--
|
|
bcmath
|
|
--FILE--
|
|
<?php
|
|
|
|
class Child extends \BcMath\Number{}
|
|
|
|
$child = new Child(1);
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Class Child cannot extend final class BcMath\Number in %s
|