pseudo-variable $this?
Posted: Wed Jul 01, 2009 2:07 pm
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
hi,
can somebody guide me find information about this variable.
it is said that this variable is used when a method is called from within an object context, as it said in manual. But why, why can't we call like that
I know this variable called pseudo-variable, I am not a programmer I hope guys can tell me why we have to use $this variable.
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
hi,
can somebody guide me find information about this variable.
it is said that this variable is used when a method is called from within an object context, as it said in manual. But why, why can't we call like that
Code: Select all
<?php
class This {
private $a=1;
public function get_a() {
//return $this->a;
return $a;
}
}
?>pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: