我传递给函数的大小重要吗?

Is important the size of what I pass to the function?

我想知道,我应该尝试向函数传递一个小值吗?还是无所谓?

例如:

$sth->execute();
function myfunc ($sth){ // do something}

$sth->execute();
$end = $sth->fetch()
function myfunc ($end){ // do something}

哪个更好?

没关系。函数调用的性能不依赖于参数的大小。值在内部处理,因此它们基本上总是通过某种引用传递。这不像 PHP 在将值传递给函数时复制值(是的,即使它可能 在用户空间中以这种方式表现 )。