可以啊，php中变量名和函数可以相同，如下我简单进行测试：


<?php

class A {


    public $foo;
    public function __construct() {
        $this->foo = 'foo';
    }

    public function foo() {
        echo 'bar';
    }

}

$a = new A();

echo $a->foo;

$a->foo();


是没有问题的。

On May 4, 2014, at 9:17 PM, Jia Huang <notifications@github.com> wrote:

> In libraries/q/query.php:
> 
> >              $this->SQL = 'SELECT '.$fields.' FROM '.$SQL;
> > -			$this->count_SQL = 'SELECT COUNT(DISTINCT '.$db->make_ident($this->table, 'id').') count FROM ' . $count_SQL;
> > -
> > +            $this->count_SQL = 'SELECT COUNT(DISTINCT '.$db->make_ident($this->table, 'id').') count FROM '. $count_SQL;
> > +            $this->sum_SQL = $sum_SQL;
> > +            $this->fields = $this->fields($this->name);
> 你这个能测试通过吗? 变量名和函数用一个?
> 
> —
> Reply to this email directly or view it on GitHub.
>