note 104068 deleted from language.oop5 by danbrown
| From: | danbrown@php.net | Date: | Mon, 23 May 2011 15:14:58 +0000 |
| Subject: | note 104068 deleted from language.oop5 by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179983@lists.php.net to get a copy of this message | ||
Note Submitter: arifrehman2003 at yahoo dot com
----
<?php
class myName
{
public $data_member1='myValue1';// without defining any func we can call it .
public $data_member2='myValue2';// but with PUBLIC only.
public function useMe($dataStore){
echo $this->data=$dataStore;//now we are accessing data for object.
}
}
$object1 = new myName();// we are creating obj.
$object2 = new myName();// each obj allocates different space in memory.
echo $object1->data_member1."<br/>";// we called it without any func.
echo $object2->data_member2."<br/>";//we called it without any func.
$object1->useMe("this is the output through func");// here through func we are calling
it.
?>