Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php $this

$this - refer properties of a class

Class A {
  	public $myname;
function callme() {
  	$myname = "Function Variable";
    $this->myname = "Member Variable";
    echo $myname; // returns Function Variable
  	echo $this->myname; // return Member Variable
}
  
Hence, I could said the same logic applies to global variable and local variable.
  
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php
ADD COMMENT
Topic
Name
5+1 =