TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
455 B
22 lines
455 B
<?php
|
|
|
|
function multiplyDecimalByInt(int $factor): string
|
|
{
|
|
$value = std::decimal('123.456');
|
|
$value = $value * 1000;
|
|
$value = $value * $factor;
|
|
return $value->toString();
|
|
}
|
|
|
|
function multiplyDecimalByVar($factor): string
|
|
{
|
|
$value = std::decimal('123.456');
|
|
$value = $value * $factor;
|
|
return $value->toString();
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
echo multiplyDecimalByInt(1000), "\n";
|
|
echo multiplyDecimalByVar(1000), "\n";
|
|
}
|
|
|