mirror of
https://github.com/igorsimdyanov/php8.git
synced 2025-08-10 03:01:01 +00:00
11 lines
192 B
PHP
11 lines
192 B
PHP
<?php
|
|
function convert(int $value, ?int $factor) : int
|
|
{
|
|
$factor ??= 1_000;
|
|
return $value * $factor;
|
|
}
|
|
|
|
echo convert(5, null); // 5000
|
|
echo '<br />';
|
|
echo convert(11, 1024); // 11264
|