【发布时间】:2010-03-22 14:56:01
【问题描述】:
我将尝试通过一个例子来展示这一点:
class DogShelter
{
private $dog;
public function handleDogDirect( )
{
$this->dog = trim( $this->dog );
$this->dog = rtrim( $this->dog, 'abc' );
$this->dog = strtolower( $this->dog );
$this->dog = basename( $this->dog );
}
public function handleDogIndirect( )
{
$dog = $this->dog;
$dog = trim( $dog );
$dog = rtrim( $dog, 'abc' );
$dog = strtolower( $dog );
$dog = basename( $dog );
$this->dog = $dog;
}
}
在不同情况下哪个功能更好 - handleDogDirect 或 handleDogIndirect?
- 为什么?
- 哪一个可能更快?
- 我应该使用哪一个?
顺便说一句:
由于代表重新计算,我无法再从 wordpress 使用我的 OpenID 登录。它一直说No OpenID endpoint found.。非常感谢任何帮助。
【问题讨论】:
-
您可能应该在 meta 上询问您的 OpenID 问题。
-
如果你给出一个真实的例子会更有帮助。关于打印“hello”的最佳方式的讨论毫无意义。