[~] >>> cat t.php
<?php
function foo($value, $times)
{
for ($i = 0; $i < $times; $i++) {
$value *= 2;
}
return $value;
}
var_dump(foo(1, 2), foo(2, 2), foo(3, 2));
[~] >>> php t.php
int(4)
int(8)
int(12)
[~] >>> [~] >>> cat t.php
<?php
function foo($value, $times)
{
for ($i = 0; $i < $times; $i++) {
$value *= 2;
}
return $value;
}
var_dump(foo(1, 2), foo(2, 2), foo(3, 2));
[~] >>> php t.php
int(4)
int(8)
int(12)
[~] >>>