LoginSignup
0
0

More than 3 years have passed since last update.

$thisとは

PHPでスコープ外で定義された変数を利用するための擬似変数

thisがある時とない時の違い

class numbers{

  public $number = 'one';

  public function saynumber(){
    $number = 'two';

    echo $number;//出力結果はtwo
    echo $this->number;//出力結果はone
  }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0