Why does this not make a difference between property and variable?

后端 未结 4 1979
旧时难觅i
旧时难觅i 2021-01-21 00:23
class someclass
{
    public $foo = \'abcd\';

    public function __construct($data)
    {
        $this->foo = $data;
    }
    public function doSomething()
    {
         


        
4条回答
  •  失恋的感觉
    2021-01-21 00:48

    change this

    echo $foo = $_POST['foo'];
    

    to

    echo $this->foo = $_POST['foo'];
    var_dump($this->foo);
    

提交回复
热议问题