@ 2025-01-19T09:22:31Z <?php
declare(strict_types=1);
error_reporting(E_ALL);
$num1 = new \BcMath\Number('0.12345');
$otherValuesNoFrac = [
'BC' => new \BcMath\Number('2.1'),
'int' => 2,
'float' => 2.1,
'numeric-string' => '2.1',
'non-numeric-string' => 'xyz',
'bool' => true,
'null' => null,
'array' => [],
'object' => new stdClass(),
'resource' => fopen('php://input', 'r'),
'closure' => static fn () => 1,
'generator' => (function () { yield 1; })(),
'stringable' => new class implements Stringable {
public function __toString()
{
return '1.0';
}
},
];
$binaryOps = [
'+' => static fn ($a, $b) => $a + $b,
'-' => static fn ($a, $b) => $a - $b,
'*' => static fn ($a, $b) => $a * $b,
'/' => static fn ($a, $b) => $a / $b,
'%' => static fn ($a, $b) => $a % $b,
'.' => static fn ($a, $b) => $a . $b,
'**' => static fn ($a, $b) => $a ** $b,
'<<' => static fn ($a, $b) => $a << $b,
'>>' => static fn ($a, $b) => $a >> $b,
'<' => static fn ($a, $b) => $a < $b,
'<=' => static fn ($a, $b) => $a <= $b,
'>' => static fn ($a, $b) => $a >=$b,
'>=' => static fn ($a, $b) => $a >= $b,
'<=>' => static fn ($a, $b) => $a <=> $b,
'==' => static fn ($a, $b) => $a == $b,
'!=' => static fn ($a, $b) => $a != $b,
'&' => static fn ($a, $b) => $a & $b,
'^' => static fn ($a, $b) => $a ^ $b,
'|' => static fn ($a, $b) => $a | $b,
'&&' => static fn ($a, $b) => $a && $b,
'||' => static fn ($a, $b) => $a || $b,
'and' => static fn ($a, $b) => $a and $b,
'xor' => static fn ($a, $b) => $a xor $b,
'or' => static fn ($a, $b) => $a or $b,
];
$separator = '------------------------------';
foreach ($otherValuesNoFrac as $name => $otherVal) {
echo "{$separator} BC vs {$name} {$separator}\n";
foreach ($binaryOps as $op => $fn) {
echo "{$op}: ";
try {
var_dump($fn($num1, $otherVal));
} catch (Throwable $e) {
echo $e::class . ': ' . $e->getMessage() . "\n";
}
}
if ($name === 'BC') {
continue;
}
echo "{$separator} {$name} vs BC {$separator}\n";
foreach ($binaryOps as $op => $fn) {
echo "{$op}: ";
try {
var_dump($fn($otherVal, $num1));
} catch (Throwable $e) {
echo $e::class . ': ' . $e->getMessage() . "\n";
}
}
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.4.2 - 8.4.12 ------------------------------ BC vs BC ------------------------------
+: object(BcMath\Number)#32 (2) {
["value"]=>
string(7) "2.22345"
["scale"]=>
int(5)
}
-: object(BcMath\Number)#32 (2) {
["value"]=>
string(8) "-1.97655"
["scale"]=>
int(5)
}
*: object(BcMath\Number)#32 (2) {
["value"]=>
string(8) "0.259245"
["scale"]=>
int(6)
}
/: object(BcMath\Number)#32 (2) {
["value"]=>
string(17) "0.058785714285714"
["scale"]=>
int(15)
}
%: object(BcMath\Number)#32 (2) {
["value"]=>
string(7) "0.12345"
["scale"]=>
int(5)
}
.: string(10) "0.123452.1"
**: ValueError: exponent cannot have a fractional part
<<: TypeError: Unsupported operand types: BcMath\Number << BcMath\Number
>>: TypeError: Unsupported operand types: BcMath\Number >> BcMath\Number
<: bool(true)
<=: bool(true)
>: bool(false)
>=: bool(false)
<=>: int(-1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & BcMath\Number
^: TypeError: Unsupported operand types: BcMath\Number ^ BcMath\Number
|: TypeError: Unsupported operand types: BcMath\Number | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs int ------------------------------
+: object(BcMath\Number)#32 (2) {
["value"]=>
string(7) "2.12345"
["scale"]=>
int(5)
}
-: object(BcMath\Number)#32 (2) {
["value"]=>
string(8) "-1.87655"
["scale"]=>
int(5)
}
*: object(BcMath\Number)#32 (2) {
["value"]=>
string(7) "0.24690"
["scale"]=>
int(5)
}
/: object(BcMath\Number)#32 (2) {
["value"]=>
string(8) "0.061725"
["scale"]=>
int(6)
}
%: object(BcMath\Number)#32 (2) {
["value"]=>
string(7) "0.12345"
["scale"]=>
int(5)
}
.: string(8) "0.123452"
**: object(BcMath\Number)#32 (2) {
["value"]=>
string(12) "0.0152399025"
["scale"]=>
int(10)
}
<<: TypeError: Unsupported operand types: BcMath\Number << int
>>: TypeError: Unsupported operand types: BcMath\Number >> int
<: bool(true)
<=: bool(true)
>: bool(false)
>=: bool(false)
<=>: int(-1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & int
^: TypeError: Unsupported operand types: BcMath\Number ^ int
|: TypeError: Unsupported operand types: BcMath\Number | int
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ int vs BC ------------------------------
+: object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "2.12345"
["scale"]=>
int(5)
}
-: object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "1.87655"
["scale"]=>
int(5)
}
*: object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "0.24690"
["scale"]=>
int(5)
}
/: object(BcMath\Number)#33 (2) {
["value"]=>
string(12) "16.200891049"
["scale"]=>
int(9)
}
%: object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "0.02480"
["scale"]=>
int(5)
}
.: string(8) "20.12345"
**: ValueError: exponent cannot have a fractional part
<<: TypeError: Unsupported operand types: int << BcMath\Number
>>: TypeError: Unsupported operand types: int >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(true)
>=: bool(true)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: int & BcMath\Number
^: TypeError: Unsupported operand types: int ^ BcMath\Number
|: TypeError: Unsupported operand types: int | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs float ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + float
-: TypeError: Unsupported operand types: BcMath\Number - float
*: TypeError: Unsupported operand types: BcMath\Number * float
/: TypeError: Unsupported operand types: BcMath\Number / float
%: TypeError: Unsupported operand types: BcMath\Number % float
.: string(10) "0.123452.1"
**: TypeError: Unsupported operand types: BcMath\Number ** float
<<: TypeError: Unsupported operand types: BcMath\Number << float
>>: TypeError: Unsupported operand types: BcMath\Number >> float
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & float
^: TypeError: Unsupported operand types: BcMath\Number ^ float
|: TypeError: Unsupported operand types: BcMath\Number | float
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ float vs BC ------------------------------
+: TypeError: Unsupported operand types: float + BcMath\Number
-: TypeError: Unsupported operand types: float - BcMath\Number
*: TypeError: Unsupported operand types: float * BcMath\Number
/: TypeError: Unsupported operand types: float / BcMath\Number
%:
Deprecated: Implicit conversion from float 2.1 to int loses precision in /in/jYX5J on line 31
TypeError: Unsupported operand types: float % BcMath\Number
.: string(10) "2.10.12345"
**: TypeError: Unsupported operand types: float ** BcMath\Number
<<:
Deprecated: Implicit conversion from float 2.1 to int loses precision in /in/jYX5J on line 34
TypeError: Unsupported operand types: float << BcMath\Number
>>:
Deprecated: Implicit conversion from float 2.1 to int loses precision in /in/jYX5J on line 35
TypeError: Unsupported operand types: float >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&:
Deprecated: Implicit conversion from float 2.1 to int loses precision in /in/jYX5J on line 43
TypeError: Unsupported operand types: float & BcMath\Number
^:
Deprecated: Implicit conversion from float 2.1 to int loses precision in /in/jYX5J on line 44
TypeError: Unsupported operand types: float ^ BcMath\Number
|:
Deprecated: Implicit conversion from float 2.1 to int loses precision in /in/jYX5J on line 45
TypeError: Unsupported operand types: float | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs numeric-string ------------------------------
+: object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "2.22345"
["scale"]=>
int(5)
}
-: object(BcMath\Number)#33 (2) {
["value"]=>
string(8) "-1.97655"
["scale"]=>
int(5)
}
*: object(BcMath\Number)#33 (2) {
["value"]=>
string(8) "0.259245"
["scale"]=>
int(6)
}
/: object(BcMath\Number)#33 (2) {
["value"]=>
string(17) "0.058785714285714"
["scale"]=>
int(15)
}
%: object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "0.12345"
["scale"]=>
int(5)
}
.: string(10) "0.123452.1"
**: ValueError: exponent cannot have a fractional part
<<: TypeError: Unsupported operand types: BcMath\Number << string
>>: TypeError: Unsupported operand types: BcMath\Number >> string
<: bool(true)
<=: bool(true)
>: bool(false)
>=: bool(false)
<=>: int(-1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & string
^: TypeError: Unsupported operand types: BcMath\Number ^ string
|: TypeError: Unsupported operand types: BcMath\Number | string
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ numeric-string vs BC ------------------------------
+: object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "2.22345"
["scale"]=>
int(5)
}
-: object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "1.97655"
["scale"]=>
int(5)
}
*: object(BcMath\Number)#33 (2) {
["value"]=>
string(8) "0.259245"
["scale"]=>
int(6)
}
/: object(BcMath\Number)#33 (2) {
["value"]=>
string(14) "17.01093560145"
["scale"]=>
int(11)
}
%:
Deprecated: Implicit conversion from float-string "2.1" to int loses precision in /in/jYX5J on line 31
object(BcMath\Number)#33 (2) {
["value"]=>
string(7) "0.00135"
["scale"]=>
int(5)
}
.: string(10) "2.10.12345"
**: ValueError: exponent cannot have a fractional part
<<:
Deprecated: Implicit conversion from float-string "2.1" to int loses precision in /in/jYX5J on line 34
TypeError: Unsupported operand types: string << BcMath\Number
>>:
Deprecated: Implicit conversion from float-string "2.1" to int loses precision in /in/jYX5J on line 35
TypeError: Unsupported operand types: string >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(true)
>=: bool(true)
<=>: int(1)
==: bool(false)
!=: bool(true)
&:
Deprecated: Implicit conversion from float-string "2.1" to int loses precision in /in/jYX5J on line 43
TypeError: Unsupported operand types: string & BcMath\Number
^:
Deprecated: Implicit conversion from float-string "2.1" to int loses precision in /in/jYX5J on line 44
TypeError: Unsupported operand types: string ^ BcMath\Number
|:
Deprecated: Implicit conversion from float-string "2.1" to int loses precision in /in/jYX5J on line 45
TypeError: Unsupported operand types: string | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs non-numeric-string ------------------------------
+: ValueError: Right string operand cannot be converted to BcMath\Number
-: ValueError: Right string operand cannot be converted to BcMath\Number
*: ValueError: Right string operand cannot be converted to BcMath\Number
/: ValueError: Right string operand cannot be converted to BcMath\Number
%: ValueError: Right string operand cannot be converted to BcMath\Number
.: string(10) "0.12345xyz"
**: ValueError: Right string operand cannot be converted to BcMath\Number
<<: TypeError: Unsupported operand types: BcMath\Number << string
>>: TypeError: Unsupported operand types: BcMath\Number >> string
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & string
^: TypeError: Unsupported operand types: BcMath\Number ^ string
|: TypeError: Unsupported operand types: BcMath\Number | string
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ non-numeric-string vs BC ------------------------------
+: ValueError: Left string operand cannot be converted to BcMath\Number
-: ValueError: Left string operand cannot be converted to BcMath\Number
*: ValueError: Left string operand cannot be converted to BcMath\Number
/: ValueError: Left string operand cannot be converted to BcMath\Number
%: TypeError: Unsupported operand types: string % BcMath\Number
.: string(10) "xyz0.12345"
**: ValueError: Left string operand cannot be converted to BcMath\Number
<<: TypeError: Unsupported operand types: string << BcMath\Number
>>: TypeError: Unsupported operand types: string >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: string & BcMath\Number
^: TypeError: Unsupported operand types: string ^ BcMath\Number
|: TypeError: Unsupported operand types: string | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs bool ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + bool
-: TypeError: Unsupported operand types: BcMath\Number - bool
*: TypeError: Unsupported operand types: BcMath\Number * bool
/: TypeError: Unsupported operand types: BcMath\Number / bool
%: TypeError: Unsupported operand types: BcMath\Number % bool
.: string(8) "0.123451"
**: TypeError: Unsupported operand types: BcMath\Number ** bool
<<: TypeError: Unsupported operand types: BcMath\Number << bool
>>: TypeError: Unsupported operand types: BcMath\Number >> bool
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & bool
^: TypeError: Unsupported operand types: BcMath\Number ^ bool
|: TypeError: Unsupported operand types: BcMath\Number | bool
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ bool vs BC ------------------------------
+: TypeError: Unsupported operand types: bool + BcMath\Number
-: TypeError: Unsupported operand types: bool - BcMath\Number
*: TypeError: Unsupported operand types: bool * BcMath\Number
/: TypeError: Unsupported operand types: bool / BcMath\Number
%: TypeError: Unsupported operand types: bool % BcMath\Number
.: string(8) "10.12345"
**: TypeError: Unsupported operand types: bool ** BcMath\Number
<<: TypeError: Unsupported operand types: bool << BcMath\Number
>>: TypeError: Unsupported operand types: bool >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: bool & BcMath\Number
^: TypeError: Unsupported operand types: bool ^ BcMath\Number
|: TypeError: Unsupported operand types: bool | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs null ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + null
-: TypeError: Unsupported operand types: BcMath\Number - null
*: TypeError: Unsupported operand types: BcMath\Number * null
/: TypeError: Unsupported operand types: BcMath\Number / null
%: TypeError: Unsupported operand types: BcMath\Number % null
.: string(7) "0.12345"
**: TypeError: Unsupported operand types: BcMath\Number ** null
<<: TypeError: Unsupported operand types: BcMath\Number << null
>>: TypeError: Unsupported operand types: BcMath\Number >> null
<: bool(false)
<=: bool(false)
>: bool(true)
>=: bool(true)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & null
^: TypeError: Unsupported operand types: BcMath\Number ^ null
|: TypeError: Unsupported operand types: BcMath\Number | null
&&: bool(false)
||: bool(true)
and: bool(false)
xor: bool(true)
or: bool(true)
------------------------------ null vs BC ------------------------------
+: TypeError: Unsupported operand types: null + BcMath\Number
-: TypeError: Unsupported operand types: null - BcMath\Number
*: TypeError: Unsupported operand types: null * BcMath\Number
/: TypeError: Unsupported operand types: null / BcMath\Number
%: TypeError: Unsupported operand types: null % BcMath\Number
.: string(7) "0.12345"
**: TypeError: Unsupported operand types: null ** BcMath\Number
<<: TypeError: Unsupported operand types: null << BcMath\Number
>>: TypeError: Unsupported operand types: null >> BcMath\Number
<: bool(true)
<=: bool(true)
>: bool(false)
>=: bool(false)
<=>: int(-1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: null & BcMath\Number
^: TypeError: Unsupported operand types: null ^ BcMath\Number
|: TypeError: Unsupported operand types: null | BcMath\Number
&&: bool(false)
||: bool(true)
and: bool(false)
xor: bool(true)
or: bool(true)
------------------------------ BC vs array ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + array
-: TypeError: Unsupported operand types: BcMath\Number - array
*: TypeError: Unsupported operand types: BcMath\Number * array
/: TypeError: Unsupported operand types: BcMath\Number / array
%: TypeError: Unsupported operand types: BcMath\Number % array
.:
Warning: Array to string conversion in /in/jYX5J on line 32
string(12) "0.12345Array"
**: TypeError: Unsupported operand types: BcMath\Number ** array
<<: TypeError: Unsupported operand types: BcMath\Number << array
>>: TypeError: Unsupported operand types: BcMath\Number >> array
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & array
^: TypeError: Unsupported operand types: BcMath\Number ^ array
|: TypeError: Unsupported operand types: BcMath\Number | array
&&: bool(false)
||: bool(true)
and: bool(false)
xor: bool(true)
or: bool(true)
------------------------------ array vs BC ------------------------------
+: TypeError: Unsupported operand types: array + BcMath\Number
-: TypeError: Unsupported operand types: array - BcMath\Number
*: TypeError: Unsupported operand types: array * BcMath\Number
/: TypeError: Unsupported operand types: array / BcMath\Number
%: TypeError: Unsupported operand types: array % BcMath\Number
.:
Warning: Array to string conversion in /in/jYX5J on line 32
string(12) "Array0.12345"
**: TypeError: Unsupported operand types: array ** BcMath\Number
<<: TypeError: Unsupported operand types: array << BcMath\Number
>>: TypeError: Unsupported operand types: array >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: array & BcMath\Number
^: TypeError: Unsupported operand types: array ^ BcMath\Number
|: TypeError: Unsupported operand types: array | BcMath\Number
&&: bool(false)
||: bool(true)
and: bool(false)
xor: bool(true)
or: bool(true)
------------------------------ BC vs object ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + stdClass
-: TypeError: Unsupported operand types: BcMath\Number - stdClass
*: TypeError: Unsupported operand types: BcMath\Number * stdClass
/: TypeError: Unsupported operand types: BcMath\Number / stdClass
%: TypeError: Unsupported operand types: BcMath\Number % stdClass
.: Error: Object of class stdClass could not be converted to string
**: TypeError: Unsupported operand types: BcMath\Number ** stdClass
<<: TypeError: Unsupported operand types: BcMath\Number << stdClass
>>: TypeError: Unsupported operand types: BcMath\Number >> stdClass
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & stdClass
^: TypeError: Unsupported operand types: BcMath\Number ^ stdClass
|: TypeError: Unsupported operand types: BcMath\Number | stdClass
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ object vs BC ------------------------------
+: TypeError: Unsupported operand types: stdClass + BcMath\Number
-: TypeError: Unsupported operand types: stdClass - BcMath\Number
*: TypeError: Unsupported operand types: stdClass * BcMath\Number
/: TypeError: Unsupported operand types: stdClass / BcMath\Number
%: TypeError: Unsupported operand types: stdClass % BcMath\Number
.: Error: Object of class stdClass could not be converted to string
**: TypeError: Unsupported operand types: stdClass ** BcMath\Number
<<: TypeError: Unsupported operand types: stdClass << BcMath\Number
>>: TypeError: Unsupported operand types: stdClass >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: stdClass & BcMath\Number
^: TypeError: Unsupported operand types: stdClass ^ BcMath\Number
|: TypeError: Unsupported operand types: stdClass | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs resource ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + resource
-: TypeError: Unsupported operand types: BcMath\Number - resource
*: TypeError: Unsupported operand types: BcMath\Number * resource
/: TypeError: Unsupported operand types: BcMath\Number / resource
%: TypeError: Unsupported operand types: BcMath\Number % resource
.: string(21) "0.12345Resource id #7"
**: TypeError: Unsupported operand types: BcMath\Number ** resource
<<: TypeError: Unsupported operand types: BcMath\Number << resource
>>: TypeError: Unsupported operand types: BcMath\Number >> resource
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & resource
^: TypeError: Unsupported operand types: BcMath\Number ^ resource
|: TypeError: Unsupported operand types: BcMath\Number | resource
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ resource vs BC ------------------------------
+: TypeError: Unsupported operand types: resource + BcMath\Number
-: TypeError: Unsupported operand types: resource - BcMath\Number
*: TypeError: Unsupported operand types: resource * BcMath\Number
/: TypeError: Unsupported operand types: resource / BcMath\Number
%: TypeError: Unsupported operand types: resource % BcMath\Number
.: string(21) "Resource id #70.12345"
**: TypeError: Unsupported operand types: resource ** BcMath\Number
<<: TypeError: Unsupported operand types: resource << BcMath\Number
>>: TypeError: Unsupported operand types: resource >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: resource & BcMath\Number
^: TypeError: Unsupported operand types: resource ^ BcMath\Number
|: TypeError: Unsupported operand types: resource | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs closure ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + Closure
-: TypeError: Unsupported operand types: BcMath\Number - Closure
*: TypeError: Unsupported operand types: BcMath\Number * Closure
/: TypeError: Unsupported operand types: BcMath\Number / Closure
%: TypeError: Unsupported operand types: BcMath\Number % Closure
.: Error: Object of class Closure could not be converted to string
**: TypeError: Unsupported operand types: BcMath\Number ** Closure
<<: TypeError: Unsupported operand types: BcMath\Number << Closure
>>: TypeError: Unsupported operand types: BcMath\Number >> Closure
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & Closure
^: TypeError: Unsupported operand types: BcMath\Number ^ Closure
|: TypeError: Unsupported operand types: BcMath\Number | Closure
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ closure vs BC ------------------------------
+: TypeError: Unsupported operand types: Closure + BcMath\Number
-: TypeError: Unsupported operand types: Closure - BcMath\Number
*: TypeError: Unsupported operand types: Closure * BcMath\Number
/: TypeError: Unsupported operand types: Closure / BcMath\Number
%: TypeError: Unsupported operand types: Closure % BcMath\Number
.: Error: Object of class Closure could not be converted to string
**: TypeError: Unsupported operand types: Closure ** BcMath\Number
<<: TypeError: Unsupported operand types: Closure << BcMath\Number
>>: TypeError: Unsupported operand types: Closure >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: Closure & BcMath\Number
^: TypeError: Unsupported operand types: Closure ^ BcMath\Number
|: TypeError: Unsupported operand types: Closure | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs generator ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + Generator
-: TypeError: Unsupported operand types: BcMath\Number - Generator
*: TypeError: Unsupported operand types: BcMath\Number * Generator
/: TypeError: Unsupported operand types: BcMath\Number / Generator
%: TypeError: Unsupported operand types: BcMath\Number % Generator
.: Error: Object of class Generator could not be converted to string
**: TypeError: Unsupported operand types: BcMath\Number ** Generator
<<: TypeError: Unsupported operand types: BcMath\Number << Generator
>>: TypeError: Unsupported operand types: BcMath\Number >> Generator
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & Generator
^: TypeError: Unsupported operand types: BcMath\Number ^ Generator
|: TypeError: Unsupported operand types: BcMath\Number | Generator
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ generator vs BC ------------------------------
+: TypeError: Unsupported operand types: Generator + BcMath\Number
-: TypeError: Unsupported operand types: Generator - BcMath\Number
*: TypeError: Unsupported operand types: Generator * BcMath\Number
/: TypeError: Unsupported operand types: Generator / BcMath\Number
%: TypeError: Unsupported operand types: Generator % BcMath\Number
.: Error: Object of class Generator could not be converted to string
**: TypeError: Unsupported operand types: Generator ** BcMath\Number
<<: TypeError: Unsupported operand types: Generator << BcMath\Number
>>: TypeError: Unsupported operand types: Generator >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: Generator & BcMath\Number
^: TypeError: Unsupported operand types: Generator ^ BcMath\Number
|: TypeError: Unsupported operand types: Generator | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ BC vs stringable ------------------------------
+: TypeError: Unsupported operand types: BcMath\Number + Stringable@anonymous
-: TypeError: Unsupported operand types: BcMath\Number - Stringable@anonymous
*: TypeError: Unsupported operand types: BcMath\Number * Stringable@anonymous
/: TypeError: Unsupported operand types: BcMath\Number / Stringable@anonymous
%: TypeError: Unsupported operand types: BcMath\Number % Stringable@anonymous
.: string(10) "0.123451.0"
**: TypeError: Unsupported operand types: BcMath\Number ** Stringable@anonymous
<<: TypeError: Unsupported operand types: BcMath\Number << Stringable@anonymous
>>: TypeError: Unsupported operand types: BcMath\Number >> Stringable@anonymous
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: BcMath\Number & Stringable@anonymous
^: TypeError: Unsupported operand types: BcMath\Number ^ Stringable@anonymous
|: TypeError: Unsupported operand types: BcMath\Number | Stringable@anonymous
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
------------------------------ stringable vs BC ------------------------------
+: TypeError: Unsupported operand types: Stringable@anonymous + BcMath\Number
-: TypeError: Unsupported operand types: Stringable@anonymous - BcMath\Number
*: TypeError: Unsupported operand types: Stringable@anonymous * BcMath\Number
/: TypeError: Unsupported operand types: Stringable@anonymous / BcMath\Number
%: TypeError: Unsupported operand types: Stringable@anonymous % BcMath\Number
.: string(10) "1.00.12345"
**: TypeError: Unsupported operand types: Stringable@anonymous ** BcMath\Number
<<: TypeError: Unsupported operand types: Stringable@anonymous << BcMath\Number
>>: TypeError: Unsupported operand types: Stringable@anonymous >> BcMath\Number
<: bool(false)
<=: bool(false)
>: bool(false)
>=: bool(false)
<=>: int(1)
==: bool(false)
!=: bool(true)
&: TypeError: Unsupported operand types: Stringable@anonymous & BcMath\Number
^: TypeError: Unsupported operand types: Stringable@anonymous ^ BcMath\Number
|: TypeError: Unsupported operand types: Stringable@anonymous | BcMath\Number
&&: bool(true)
||: bool(true)
and: bool(true)
xor: bool(false)
or: bool(true)
Output for 8.1.32 , 8.2.27 - 8.2.29 , 8.3.5 - 8.3.25 Fatal error: Uncaught Error: Class "BcMath\Number" not found in /in/jYX5J:5
Stack trace:
#0 {main}
thrown in /in/jYX5J on line 5
Process exited with code 255 . preferences:dark mode live preview ace vim emacs key bindings
58.99 ms | 435 KiB | 5 Q